1

Topic: HttpSendRequest () returns ERROR_HTTP_HEADER_NOT_FOUND

Call HttpSendRequest (), for request "PUT", returns FALSE, GetLastError () = ERROR_HTTP_HEADER_NOT_FOUND.

Tried to add in an explicit form Content-Length - does not help. That can not suffice it?

2

Re: HttpSendRequest () returns ERROR_HTTP_HEADER_NOT_FOUND

"Cavaler" <43627@users.rn> wrote in message
...

> Call HttpSendRequest (), for request "PUT", returns FALSE, GetLastError () = ERROR_HTTP_HEADER_NOT_FOUND.
> Tried to add in an explicit form Content-Length  does not help. That can not suffice it?


And you it is exact PUT it is necessary? Can POST?

3

Re: HttpSendRequest () returns ERROR_HTTP_HEADER_NOT_FOUND

Hello, wellwell, you wrote:

>> Call HttpSendRequest (), for request "PUT", returns FALSE, GetLastError () = ERROR_HTTP_HEADER_NOT_FOUND.
>> Tried to add in an explicit form Content-Length  does not help. That can not suffice it?

W> And you it is exact PUT it is necessary? Can POST?


In the documentation has been written to use PUT. And even if POST works, it would be desirable to understand in what business...

4

Re: HttpSendRequest () returns ERROR_HTTP_HEADER_NOT_FOUND

"Cavaler" <43627@users.rn> wrote in message
...

>>> Call HttpSendRequest (), for request "PUT", returns FALSE, GetLastError () = ERROR_HTTP_HEADER_NOT_FOUND.
>>> Tried to add in an explicit form Content-Length  does not help. That can not suffice it?
> W> And you it is exact PUT it is necessary? Can POST?
> In the documentation has been written to use PUT. And even if POST works, it would be desirable to understand in what business...


Well as the variant, the server can not support PUT (though it should then to return METHOD_NOT_ALLOWED). Show the code completely.

5

Re: HttpSendRequest () returns ERROR_HTTP_HEADER_NOT_FOUND

Hello, wellwell, you wrote:

>>>> Call HttpSendRequest (), for request "PUT", returns FALSE, GetLastError () = ERROR_HTTP_HEADER_NOT_FOUND.
>>>> Tried to add in an explicit form Content-Length  does not help. That can not suffice it?
>> W> And you it is exact PUT it is necessary? Can POST?
>> In the documentation has been written to use PUT. And even if POST works, it would be desirable to understand in what business...

W> Well as the variant, the server can not support PUT (though it should then to return METHOD_NOT_ALLOWED). Show the code completely.


The error is returned explicitly __ reversal to the server, at once WinInet.


Briefly:


HINTERNET hRequest = HttpOpenRequest (m_hConnect, pData? "PUT": "GET", "/interface/simple", "HTTP/1.1", NULL,

NULL, INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_NO_COOKIES|INTERNET_FLAG_RELOAD, 0);

HttpAddRequestHeaders (hRequest, ("Content-Length:" + FormatStr ("%d", dwSize)).c_str (),-1, HTTP_ADDREQ_FLAG_ADD);

f (! HttpSendRequest (hRequest, szHeaders, szHeaders?-1: 0, pData, dwSize)) return GetLastError ();

6

Re: HttpSendRequest () returns ERROR_HTTP_HEADER_NOT_FOUND

"Cavaler" <43627@users.rn> wrote in message
...

> The error is returned explicitly __ reversal to the server, at once WinInet.
> Briefly:


And here from MSDN you similar did not consider it:

http://msdn.microsoft.com/library/defau … eaders.asp

lpszHeaders [in] Pointer to a string variable containing the headers to append to the request.
Each header must be terminated by a CR/LF (carriage return/line feed) pair.

7

Re: HttpSendRequest () returns ERROR_HTTP_HEADER_NOT_FOUND

Hello, wellwell, you wrote:

>> the Error is returned explicitly __ reversal to the server, at once WinInet.
>> Briefly:

W> and here from MSDN you similar did not consider it:
W>
http://msdn.microsoft.com/library/defau … eaders.asp
W> lpszHeaders [in] Pointer to a string variable containing the headers to append to the request.
Each header must be terminated by a CR/LF (carriage return/line feed) pair.


I somehow it understood that titles are divided \r\n (that clearly). And in other places where I GET to something did, all worked normally.

Tried to attribute \r\n - did not help.


And here that at me in szHeaders, transferred in HttpSendRequest (), one of titles was without value helped. Type "X-FB-Meta. Description: \r\n"...