Do i need to add any headers before making a post to server?
For example, Currently I'm trying to send a request along with the post data this way,
LPCWSTR post = L"name=User&subject=Hi&message=Hi";
if (!(WinHttpSendRequest( hRequest,
WINHTTP_NO_ADDITIONAL_HEADERS,
0, (LPVOID)post, wcslen(post),
wcslen(post), 0)))
{
//error
}
should this work?
LPSTR post = "log=test";//in my php file: if(isset($_POST['log']))
hRequest = WinHttpOpenRequest(hConnect,
L"POST",
L"/test.php",
NULL,
WINHTTP_NO_REFERER,
WINHTTP_DEFAULT_ACCEPT_TYPES,
0);
bResults = WinHttpSendRequest(hRequest,
L"content-type:application/x-www-form-urlencoded",
-1,
post,
strlen(post),
strlen(post),
NULL);