dears
i'm new to c++ and i'm trying to make some demos application
now i'm buildin an application that use http connection to make http request and get a return value from URL
example: use http://www.mywebsite.com/somthing.aspx

this URL should returm a simple string value
how i can read this value??

Recommended Answers

Please follow the below link and if you face some problem let me know.

Thanks

http://www.mosync.com/documentation/manualpages/http-connections

Jump to Post

All 4 Replies

When you have sent the HTTP request the data returned to you will be some headers followed by the contents of your page.

It will all be text and for now you can probably treat it as ASCII encoded text although strictly speaking HTTP can use a wide variety of text encodings.

Every header will be on a separate line, there is a list of possible headers here and every response will contain at least one header.

Following the last header there is a blank line before the start of the content.

So to find your content, the simple string, just read what is sent to you discarding everything until you get a blank line and the keep the rest.

dears thx fol your reply, it was helfull

You may use third party library like libcURL(http://curl.haxx.se/libcurl/) which works well in fetching such webpage as strings.

If you problem is solved, please mark the thread as solved so that others don't waste time on this problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.