Ok, I very much needed this solution, so I analyze procedure TLHTTPClientSocket.SendRequest. By default, http client does not send absolutely no header (only host), so I sniff what sends synapse and do this same by AddExtraHeader procedure. XML is just new text block in document so I add this by AddExtraHeader too. This is solution code which work, maybe someone need this too:
DecomposeURL('h t tp://some.host.com/login.xml', sHost, sUrl, sPort);
httpclient.Method := hmPost;
httpclient.Port := sPort;
httpclient.Host := sHost;
httpclient.URI := sUrl;
httpclient.AddExtraHeader('Keep-Alive: 300');
httpclient.AddExtraHeader('Connection: keep-alive');
httpclient.AddExtraHeader('Content-Length: 111'); // <-XML length
httpclient.AddExtraHeader('Content-Type: application/xml; charset=utf-8');
httpclient.AddExtraHeader(LineEnding);
httpclient.AddExtraHeader(
'<?xml version="1.0"?>' + LineEnding +
'<login>'+ LineEnding +
'dibo'+ LineEnding +
'</login>'
);
httpclient.SendRequest;
LHTTPClient is a very good socket but lacks some basic features visible for programmer (and PUT, DELETE http methods).
But this is not the end of my problems
. There is demo how to download file, but there is no how to upload
. Maybe I'll find a way ...
Regards