Solved

C++ URL connection example

Posted on 2013-01-04
4
612 Views
Last Modified: 2013-01-24
I need an example of a C++ class that will connect to a URL and read XML line by line.
Please advise.
0
Comment
Question by:dpalyca755
4 Comments
 
LVL 19

Expert Comment

by:drichards
ID: 38747055
Your question is underspecified.

For what platform and dev tools?
What protocol on the URL?
Does it need to be raw socket or can you use a client class from your dev environment?

XML line-by-line does not make sense as you will end up with a bunch of nonsense text that needs to be reassembled into usable XML which means also writing XML parsing code.  Why not use an XML parser?
0
 
LVL 22

Accepted Solution

by:
ambience earned 500 total points
ID: 38748218
I would recommend POCO toolkit and heres sample source from their unit tests that reads HTTP response line by line. I agree with drichards that reading XML line by line does not make much sense even for a parser that supports streaming.

https://github.com/pocoproject/poco/blob/develop/Net/testsuite/src/HTTPClientSessionTest.cpp

This is a Twitter client written with POCO (from samples), it does pretty much everything you might be interested in

https://github.com/pocoproject/poco/blob/develop/Net/samples/TwitterClient/src/Twitter.cpp
0
 
LVL 8

Expert Comment

by:Pramod Bugudai
ID: 38792457
I have simple exampl over here.

http://support.microsoft.com/kb/815659
0
 
LVL 11

Expert Comment

by:DeepuAbrahamK
ID: 38808728
Is this on windows/unix ?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question