Sign in to follow this  

Talking to a php page via sockets

This topic is 3743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I'd like to have your inputs on what would be the best way to A) Download the content of an html/php page from a C/C++ program B) Send a form via POST to a PHP page (from the C program) The tricky part : i want to do it with internet sockets send/recv After some research, looks like libcurl would best suit my need. But for the experience, I would like to do it directly with the sockets. Thanks for any lights on this.

Share this post


Link to post
Share on other sites
Quote:
The tricky part : i want to do it with internet sockets send/recv

After some research, looks like libcurl would best suit my need. But for the experience, I would like to do it directly with the sockets.


Ok, so you'll implement HTTP protocol, along with all the queries and required handlings, encodings, as well as streaming logic.

So... why not use an existing library?

HTTP isn't a complex protocol, but it's an annoying one. If this is for broad general use, you'll need to support it reliably, including various security extensions.

If it's for one particular page only - why waste time?

The easiest way to do this bare bones is probably to manually construct HTTP requests strings, and send those. It might be possible to even ignore the result. Just go through HTTP RFC to see what you need to send.

wget or wput (is there such a thing, or can wget do it?) should solve this without programming altogether.

Share this post


Link to post
Share on other sites

This topic is 3743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this