hi,代码如下:TCHAR hdrs[1024] ={0};
::wcscat(hdrs,L"POST /user/mologin.php HTTP/1.1");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Host:kacha.host1.sinodns.net");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Content-Type: application/x-www-form-urlencoded");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Content-Length: 69");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Connection: close");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"utype=email&[email protected]&password=123456&expire=31536000");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"\r\n"); bSend = HttpSendRequest(hHttp,hdrs, -1L,NULL, 0); //this code always return error code 87. "The parameter is incorrect. "
if(bSend == FALSE)
{
dwGetLastError = GetLastError();
MessageBox(NULL,L"error5",L"error5",MB_OK);
}我不太清楚函数参数该怎么改正。怎样解决 ?谢谢.
::wcscat(hdrs,L"POST /user/mologin.php HTTP/1.1");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Host:kacha.host1.sinodns.net");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Content-Type: application/x-www-form-urlencoded");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Content-Length: 69");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Connection: close");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"utype=email&[email protected]&password=123456&expire=31536000");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"\r\n"); bSend = HttpSendRequest(hHttp,hdrs, -1L,NULL, 0); //this code always return error code 87. "The parameter is incorrect. "
if(bSend == FALSE)
{
dwGetLastError = GetLastError();
MessageBox(NULL,L"error5",L"error5",MB_OK);
}我不太清楚函数参数该怎么改正。怎样解决 ?谢谢.
不知是我的header写的有问题,还是其它的问题。header如下写的:TCHAR hdrs[1024] ={0};
::wcscat(hdrs,L"POST /user/mologin.php HTTP/1.1");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Host:kacha.host1.sinodns.net");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Content-Type: application/x-www-form-urlencoded");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Content-Length: 69");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"Connection: close");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"utype=email&[email protected]&password=123456&expire=31536000");
::wcscat(hdrs,L"\r\n");
::wcscat(hdrs,L"\r\n");