Hi!
I have a question about WIP HTTP library. I’m trying to send some data usting HTTP_POST request. First of all I make HTTP client connection socket with:
http_ClientPutCtx.CnxChannel = wip_HTTPClientCreateOpts(
HTTP_Put_Connect_DataHandler,
NULL, // no context
// default headers
WIP_COPT_HTTP_PROXY_PORT, HTTP_PORT,
WIP_COPT_USER,"stupid" ,
WIP_COPT_PASSWORD,"user",
WIP_COPT_END);
In HTTP_Put_Connect_DataHandler:
http_ClientPutCtx.DataChannel = wip_getFileOpts(
http_ClientPutCtx.CnxChannel, // session channel
HTTP_STR_URL, // requested URL
HTTP_Put_DataHandler, // data handler
&http_ClientPutCtx, // context
// request headers
WIP_COPT_HTTP_METHOD,WIP_HTTP_METHOD_POST,
WIP_COPT_HTTP_HEADER, "Content-Length",tmplen ,
WIP_COPT_HTTP_HEADER, "Content-Type","application/x-www-form-urlencoded",
WIP_COPT_END);
In HTTP_Put_DataHandler i call wip_write:
nwrite = wip_write( http_ClientPutCtx.DataChannel,"This is a test!", 15);
On the server side i see correct POST-header:
POST /icm/i5test/ HTTP/1.1
Host: 195.98.91.219:8085
Transfer-Encoding: chunked
Authorization: Basic c3R1cGlkOmhhY2tlcg==
Content-Length: 76
Content-Type: application/x-www-form-urlencoded
but in POST-data[body] I recive this string:
15
This is a te
Seems like wip_write sends first string length, and last 3 bytes are lost. Anybody knows, is this a bug or a feature?
P.S. Most strange thing for me is that wip_write works well with FTP and UDP sockets in my previous projects.