954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Example of HTTP POST in C++?

I'm working on a program in visual c++ that I need some help on. I'm new to c++ and I can't seem to figure out how to do a http POST.

The program gets a username and password from a form, and then it's supposed to send the username and password to a webserver and retrieve the results in a string.

Any examples or good tutorials would be amazing. Thanks!

jmace
Newbie Poster
16 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

I'm assuming you're using a CLR/Winforms setup.

If so, see http://www.codeproject.com/KB/IP/httpwebrequest_response.aspx for a good example (the example's in C#, so you'll have to convert the syntax, subbing :: for the C# . that indicates namespace resolution and -> for the . that indicates member variable).

HttpWebRequest is the class that is responsible for this type of action in .NET, so searching on that will get you some more resources (and of course MSDN has all of the member methods and variables delineated).

jonsca
Quantitative Phrenologist
Team Colleague
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
 

Thanks for the post :)

Is there perhaps a simpler sample? I really just need a very stripped down version so that I can catch the concept and build on it.

jmace
Newbie Poster
16 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: