I’m trying to send data via HTTP POST through wip_write and all the time it’s adding 2 bytes as the size of the buffer (payload) transmitted,
causing the HTTP Server to refuse the request due to Malformat Package because the Content-Length does not match the payload.
See the dump bellow and note the 5f (95 decimal) at the beginning of the body.
I’m testing a wip_write command with an HTTP POST and I get an error. The submit content is this:
POST /HelloWMP/HelloServlet HTTP/1.1
p1=This is a big message that I want to send using the wip_write command via POST http method!
Content-Length should not be used with “chunked” encoding - are you adding that yourself?
No. What I’m using is this:
http_ClientTestCtx.DataChannel = wip_getFileOpts(
http_ClientTestCtx.CnxChannel, // session channel
HTTP_STR_URL, // requested URL
http_ClientTestDataHandler, // data handler
&http_ClientTestCtx, // context
// request headers
We found the problem. Actually the data transmitted over HTTP is chunked by default. As you said, we removed the Content-Length header and shutdown the connection after the buffer size was totally transmitted in a way that the HTTP Server was able to decode the chunked data.
Thanks for your help.
So you were adding it, then?