POST
data is not available in the OnHTTPBeforeCommand
event, as it has not been read from the socket yet. Only the HTTP headers are available in that event.
POST
data is available in the OnHTTPDocument
event, but only under the following conditions:
the
POST
request uses a non-zeroContent-Length
header (asTIdHTTPProxyServer
does not yet support theTransfer-Encoding
header to handle compressed/chunked HTTP messages).the
TIdHTTPProxyServerContext.TransferMode
property istmFullDocument
when theOnHTTPBeforeCommand
event exits. By default, theTransferMode
is set to the same value as theTIdHTTPProxyServer.DefaultTransferMode
property, which istmFullDocument
by default.the client sends the
POST
request directly toTIdHTTPProxyServer
, specifying a full URL as the target. If the client instead sends aCONNECT
request directly toTIdHTTPProxyServer
to establish a tunnel to the target server and then sends thePOST
request through the tunnel to the target server (for instance, when establishing SSL sessions for HTTPS requests),TIdHTTPProxyServer
does not expose access to that data. It is a straight pass-through from one socket to another.