Are you using chunked transfer encoding, or something else?
That's what I'm doing, at least I'm trying to, but it's still not working.
Do you have an example sending it with a THttpCli ?
No, just with httpserver. Are you able to properly set up the encoding, or it just don't work as you want, and the connection continues to close.
Here is how I, generically, made it


   Header := 'HTTP/1.1 200 OK' + crlf;
   Header := Header + 'Connection: keep-alive' + crlf;
   Header := Header + 'Transfer-Encoding: chunked' + crlf;
   HttpConnection.SendStr(Header + crlf);
   s := IntToHex(BufLen, 2) + crlf;
   HttpConnection.Send(@s[1], Length(s));
   HttpConnection.Send(buf, BufLen)
   HttpConnection.Send(@crlf[1], 2)

And you have to repeat the above code until all data you need to send is sent.
When all sent:

   s := '0' + crlf + crlf;
   HttpConnection.send(@s[1], length(s));

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to