Include the hoKeepOrigProtocol parameter in the hoKeepOrigProtocol property HTTPOptions (set it to True). Except that the ProtocolVersion property is set to pv1_1 (which is the default value).
The TIdCustomHTTP.Post method TIdCustomHTTP.Post has a comment explaining the current behavior:
Currently, when sending a POST, IdHTTP automatically installs the protocol to version 1.0, regardless of its initial value. This is due to the fact that there are some servers that do not fully respect RFC. In particular, they do not respect the sending / non-sending header of the Expect: 100-Continue header. Until we find the best solution that does NOT violate the RFC, we will limit POSTS to version 1.0.
A few lines below is a change in version 1.0 with the following comment:
// If hoKeepOrigProtocol is SET, it is possible to assume that the developer // is sure in operations of the server if not (hoKeepOrigProtocol in FOptions) then begin if Connected then begin Disconnect; end; FProtocolVersion := pv1_0; end;
And the above code is skipped (the version does not change) if you have the hoKeepOrigProtocol option included in HTTPOptions .
source share