You need to get rid of these lines:
HTTP2.Request.ContentEncoding := 'gzip, deflate';
HTTP.Request.AcceptEncoding := 'gzip,deflate';
TIdHTTP
manages those values for you based on whether its Compressor
property is assigned and enabled. And, you are not sending a compressed request, so those values should not be used anyway.
Also, you need to get rid of this line:
HTTP.Request.ContentType :=
'multipart/form-data; boundary=----------GI3Ef1cH2GI3gL6ae0Ef1KM7Ef1gL6';
Post()
manages that value for you, especially the boundary
, which TIdMultipartFormDtaStream
generates dynamically.
Update the only other place that Content-Transfer-Encoding
is used is on the individual fields of the TIdMultipartFormDataStream
. Each TIdFormDataField
has a ContentTransfer
property. AddFile()
initializes it to 'binary'
, but you can also set it to a blank string to disable the header:
params.AddFile(...).ContentTransfer := '';