Hi,

Can you show your code please?
I am using code like this:

void __fastcall TSocketClientModule::HttpPost(UnicodeString sUrl,
UnicodeString sData, int iTimeout, int iPort)
{
        HttpClient->URL=sUrl;
        HttpClient->Timeout=iTimeout;
        HttpClient->SocksPort=iPort;
        OutData=new TMemoryStream();
        OutData->Write(sData.c_str(), sData.Length());
        OutData->Seek(0, soFromBeginning);
        HttpClient->SendStream=OutData;
        InData=new TMemoryStream();
        HttpClient->RcvdStream=InData;
        HttpClient->PostASync();
}

My sData is not XML but this should not make big difference. 
Did you test posting with 3rd party tools like for example Chrome advanced
REST client? Simply to be sure that your request URL and data are correct.

Regards

Jarek Karciarz


-----Original Message-----
From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of zayin
Sent: Sunday, March 6, 2016 7:33 PM
To: twsoc...@elists.org
Subject: [twsocket] THttpCli and XML...

Hello,

Version 7.25

For the first time I need to send an XML document to the server. 
I setup the URL for all the data.
I put the XML document in a stream and set the index to 0.
I call PostASync.
Looking at Wireshark the URL data is all there and correct.
The XML has stuff added to the front which messes up what the server expects
and reports an error. For example the "Accept" value is added to the front
of the XML data.

I must be doing something wrong.

Maybe I should not be using THttpCli and just use TWSocket, connect and
send?

Ciao,

Mark


--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to