Sending “request payload” with libcurl?

十年热恋 提交于 2019-12-10 12:30:17

问题


I am using libcurl. I know how to send form data. I want, however, to send a "request payload", but I have no idea how to.

This is what an example of what I am trying to do, in Chrome Developer Tools: View image

Can anyone please help me?


回答1:


The command-line version of what you want would be something akin to:

curl --header "Content-Type: application/json" --data '{"data":"blob"}' http://address.com

(you'll probably want to include cookie information for authentication too)

I don't know how well that translates to libcurl, but that's the essence sending a request payload with curl.



来源:https://stackoverflow.com/questions/8292997/sending-request-payload-with-libcurl

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