You are not logged in.
Pages: 1
I am executing the PUT method in OpenAPIClient
The update command itself is executed quickly. The content on the server is updated. The server returns the status 'HTTP/1.1 204 No Content'.
The header does not contain the "Content-Length" field, and therefore we get to the code section (mormot.net.http.pas) in "GetBody" procedure:
else if Http.ContentLength < 0 then // -1 means no Content-Length header
begin
// no Content-Length neither chunk -> read until the connection is closed
// also for HTTP/1.1: https://www.rfc-editor.org/rfc/rfc7230#section-3.3.3
if Assigned(OnLog) then
OnLog(sllTrace, 'GetBody deprecated loop', [], self);
// body = either Content-Length or Transfer-Encoding (HTTP/1.1 RFC2616 4.3)
if SockIn <> nil then // client loop for compatibility with oldest servers
while not eof(SockIn^) do ////////////////////////////////////////////////// THERE IS A LONG TIMEOUT HERE, depending on the settings
begin
readln(SockIn^, line);
AppendLine(RawUtf8(Http.Content), [line]);
end;
But the timeout is the same for everyone (connecttimeout, sendtimeout, recvtimeout)
How to solve this situation?
Offline
My concern is that I have seen some python servers returning HTTP 204 which in fact returned a body...
b'HTTP/1.1 204 NO CONTENT\r\n'
b'Content-Type: text/html; charset=utf-8\r\n'
b'Date: Mon, 06 Jan 2025 08:16:31 GMT\r\n'
b'Transfer-Encoding: chunked\r\n'
b'Connection: keep-alive\r\n'
b'\r\n'
b'0\r\n\r\n'
I will look into it.
Offline
I think I nailed it.
Please try with
https://github.com/synopse/mORMot2/commit/869384018
Offline
Everything is super!
Minor malfunction unrelated to the topic. An error occurred during compilation.
"mormot.core.variants.pas(7970): E2004 Identifier redeclared: 'p'". Conflict between a variable property P[const aNameOrPath: RawUtf8]
Offline
The compilation error should be fixed by
https://github.com/synopse/mORMot2/commit/adab4978d
Thanks for the report.
Offline
Pages: 1