Wip_write problem over HTTP

Hello all,

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
Host: myserver.com.br:8088
Transfer-Encoding: chunked
User-Agent: WIPHTTP/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 95

5f
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?

Hello,

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
    WIP_COPT_HTTP_METHOD,
    WIP_HTTP_METHOD_POST,
    // request headers
    WIP_COPT_HTTP_HEADER, "Content-Type",
    "application/x-www-form-urlencoded", WIP_COPT_END);

Hello,

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.

Regards

Rafael

So you were adding it, then?