• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 772
  • Last Modified:

C++ URL connection example

I need an example of a C++ class that will connect to a URL and read XML line by line.
Please advise.
0
dpalyca755
Asked:
dpalyca755
1 Solution
 
drichardsCommented:
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
 
ambienceCommented:
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
 
Pramod BugudaiCommented:
I have simple exampl over here.

http://support.microsoft.com/kb/815659
0
 
Deepu AbrahamR & D Engineering ManagerCommented:
Is this on windows/unix ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now