JeffM
2004-10-06 22:40:21 UTC
After installing Service Pack 2 for Windows XP, my Wininet code to post
form data,
which worked perfectly before, now fails.
This is the response I get back:
<h1>Bad Request</h1>
The headers I get back:
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Wed, 06 Oct 2004 06:27:21 GMT
Connection: close
Content-Length: 20
This is how I setup the post:
TCHAR hdrs[] = _T("Content-Type: application/x-www-form-urlencoded");
TCHAR accept[] = _T("*/*");
HINTERNET hSession = InternetOpen( myagent, INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0 );
HINTERNET hConnect = InternetConnect( hSession, myurl,
INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1 );
HINTERNET hRequest = HttpOpenRequest( hConnect, _T("POST"), mypage,
_T("HTTP/1.0"), NULL, (const char**)accept, 0, 1 );
HttpSendRequest( hRequest, hdrs, strlen(hdrs), (void*)LPCSTR(formdata),
strlen(formdata) );
How can I post form data using Wininet on Windows XP SP2?
What is SP2 doing to my HTTP request?
form data,
which worked perfectly before, now fails.
This is the response I get back:
<h1>Bad Request</h1>
The headers I get back:
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Wed, 06 Oct 2004 06:27:21 GMT
Connection: close
Content-Length: 20
This is how I setup the post:
TCHAR hdrs[] = _T("Content-Type: application/x-www-form-urlencoded");
TCHAR accept[] = _T("*/*");
HINTERNET hSession = InternetOpen( myagent, INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0 );
HINTERNET hConnect = InternetConnect( hSession, myurl,
INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1 );
HINTERNET hRequest = HttpOpenRequest( hConnect, _T("POST"), mypage,
_T("HTTP/1.0"), NULL, (const char**)accept, 0, 1 );
HttpSendRequest( hRequest, hdrs, strlen(hdrs), (void*)LPCSTR(formdata),
strlen(formdata) );
How can I post form data using Wininet on Windows XP SP2?
What is SP2 doing to my HTTP request?