//cstrings strSubjoinProtocolHeader;
If (strSubjoinProtocolHeader. Find (L "Accept")==1)
StrSubjoinProtocolHeader=strSubjoinProtocolHeader + L "Accept: text/HTML and application/XHTML + XML, */* \ r \ n";
If (strSubjoinProtocolHeader. Find "Accept - Encoding:" (L)==1)
StrSubjoinProtocolHeader=strSubjoinProtocolHeader + L "Accept - Encoding: GBK, GB2312 \ r \ n";
If (strSubjoinProtocolHeader. Find the "Referer:" (L)==1)
StrSubjoinProtocolHeader=strSubjoinProtocolHeader + L "Referer:" + strUrl + L "\ r \ n";
If (strSubjoinProtocolHeader. Find "Accept - Language:" (L)==1)
StrSubjoinProtocolHeader=strSubjoinProtocolHeader + L "Accept - Language: useful - cn \ r \ n";
If (strSubjoinProtocolHeader. Find "content-type:" (L)==1)
StrSubjoinProtocolHeader=strSubjoinProtocolHeader + L "content-type: application/x - WWW - form - urlencoded \ r \ n";
If (strSubjoinProtocolHeader. Find "cache-control:" (L)==1)
StrSubjoinProtocolHeader=strSubjoinProtocolHeader + L "cache-control: no - Cache \ r \ n";
If (strSubmitCookies. IsEmpty ()==FALSE)
StrSubjoinProtocolHeader="Cookie:" + strSubmitCookies strSubjoinProtocolHeader + L + L "\ r \ n";
Cstrings strTempVisitType=strVisitType;
StrTempVisitType. MakeLower ();
If (strTempVisitType==L "get")
BFlag=HttpSendRequest (hHttpRequest, strSubjoinProtocolHeader, strSubjoinProtocolHeader GetLength (), NULL, 0).
Int nError=GetLastError ();
If (bFlag==FALSE)
CodePudding user response:
12150 ERROR_HTTP_HEADER_NOT_FOUNDThe requested header could not be located.
CodePudding user response:
Directly send your bag to go to catch the HTTP header information, see whether it is rightCodePudding user response:
pay attention to the Note on the MSDNNote The HttpSendRequestA function represents headers as ISO-8859-1 characters not ANSI characters. The HttpSendRequestW function represents headers as ISO-8859-1 characters converted to UTF-16LE characters. As a result, it is never safe to use the HttpSendRequestW function when the headers to be added can contain non-ASCII characters. Instead, an application can use the MultiByteToWideChar and WideCharToMultiByte functions with a Codepage parameter set to 28591 to map between ANSI characters and UTF-16LE characters.