Honestly, I am not familiar with HTTP protocols, We want to send a http post request with two key-values to a URI, then the http server will respond with json msgs.
The picture attached shows the test result through PC. Is there an example or API document for this? Thanks a lot.
Solved! Go to Solution.
Thanks for your help, I have studied httpbin_org application. it helps but a little different. The httpbin_org application looks up the IP address from the given HOST, then setup a TCP connection, send a GET request. However, our customer's server requires to POST two key-values(Type and unique ID) first, then the server will repond the target IP address and PORT for us to connect. What I don't know is how to POST the keys...
Finally, I did like this, first look the server's IP address, then send the keys-values by tcp client, recived the target ip address and port...then setup the real TCP connetion. if you any other information about HTTP POST, please kindly let me konw, thank you!
The httpbin_org example is very similar to your use case. Change the SERVER_HOST to call.easyorder.cn, and the request_uri to /mall/.../check_watch (complete the URI). Your two key values should be written into the request with http_request_write_header and http_request_write_end_header. Change the request from HTTP_GET to HTTP_POST.
Then, you will be able to send the request and parse the response from the server
Thanks you for your patience, I modified the https_client application, it worked, and I got correct respond from our server. But the httpbin_org example still can't work. I spended up to two days to debug it...just want to figure out where is the problem. Attached is my code, please check it at your convenience. Anyway I really want to say "Thanks" for your patience.
It was perfectly solved by you, thank you very much! Maybe the example could help other developers also.