Sending postdata to url
I want to send html form data to a URL with a C++ program. I've been trying to google something for the last 2 days, but found nothing. Maybe I'm a bad searcher. Could someone point me to the right direction by giving some links or advising on how to search?
Pure WinInet...see HttpSendRequest.
I got a good tutorial on just that on my site. ;) You can get it here.
Very good tutorial, Queatrix.
However, I don't know how exactly should I send postdata.
What format should it be?
char szPostData[ ] = "\0\0";
HttpSendRequest( hRequest, szNewHeader, strlen(szNewHeader),
szPostData, strlen(szPostData) );
For example on this HTML form:
<form name="message" method="post" action="message.php">
<input name="subject" type="text">
You have to know how the browser converts form data into a string, in this case szPostData should be:
This is assuming "AAA" is what was 'typed' into the message edit box, and "BBB" is what was 'typed' in the subject edit line.
char szPostData[ ] = "message=AAA&subject=BBB\0";
Oh, if it's as easy as sending the postdata from url, then thanks very much!