Can you provide the sniffer trace that you acquired with Wireshark?
It appears as though you will have more luck debugging the other HTTP endpoint as to why it is interpreting the package as gibberish.
Thanks nikvh. I was interested in whether anyone had built applications using HTTP POST requests, and whether the wiced_http_get function was designed to be used with body content. Next step would be debugging from the endpoints, which have worked with all other platforms I have tried.
I am wondering the same think.
Any info on this would be great.
Try apitools.com for debugging and let me know if you have luck.
it does work for me.
My server receives and responds correctly to my post requests.
I used your code from above
show your log,mybe i can help you.
Are you still looking for solutions?
http_stream contain the appropriate functions for you to POST.
You might want to take a look at
wiced_result_t http_stream_start_headers ( http_stream_t* session, http_request_t method, const char* url );
method = HTTP_POST;
Hey! I was trying to use the wiced_http_get to make a post request it keeps failing for me. This is how I am editing the Simple_Get_Request:
#define SIMPLE_POST_REQUEST \ "POST /api/useridentity HTTP/1.1\r\n" \ "Host: \r\n" \ "mac: 89732jshgusz\r\n" \ "Connection: close\r\n" \ "body:identifier=awesome&awesome22=awesome2013 \r\n"\ "Content-Type: application/x-www-form-urlencoded \r\n" \ "\r\n"\ "identifier=awesome&identifier2=2013 \r\n"\ "\r\n"
This is how I am calling the wiced_http_get function:
wiced_http_get( &ip_address, SIMPLE_POST_REQUEST, buffer, BUFFER_LENGTH);
What is the mistake that I am making here?
Please try adding sprintf(post, SIMPLE_POST_REQUEST);
That didn't work. What I actually was missing was the content-length header without which the http protocol ignores the body. The moment I added content-length header, it worked like a charm.