发送“请求有效载荷"并发送给请求服务器.与libcurl吗? [英] Sending "request payload" with libcurl?

查看:65
本文介绍了发送“请求有效载荷"并发送给请求服务器.与libcurl吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 libcurl .我知道如何发送表格数据.但是,我想发送请求有效负载" ,但是我不知道如何发送.

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.

这是我要在Chrome开发者工具中尝试执行的操作的示例:查看图像

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

有人可以帮助我吗?

推荐答案

所需的命令行版本类似于:

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

(您可能还希望包括cookie信息以进行身份​​验证)

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

我不知道它翻译成libcurl的程度如何,但这就是发送带有卷曲的请求有效载荷.

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

这篇关于发送“请求有效载荷"并发送给请求服务器.与libcurl吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆