Solved

C++ URL connection example

Posted on 2013-01-04
4
636 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

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