HTTP POST request using boost::asio

吃可爱长大的小学妹 提交于 2019-12-22 16:42:35

问题


Where can I see an example of HTTP POST request using boost::asio?

I've only saw some examples with HTTP GET requests.


回答1:


Look at this http request header for example:

POST /path/script.cgi HTTP/1.0
From: test@tests.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32

argument1=text&argument2=arg2text

Check out the get example and change the request to this. Probably alter whatever you think should be altered




回答2:


See How are parameters sent in an HTTP POST request?

The ASIO part (sending the data) is similar to the example with GET. The difference is what data is sent (HTTP header and content).



来源:https://stackoverflow.com/questions/19562786/http-post-request-using-boostasio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!