如何在xcode中使用curl和c++的rest API
how to use rest api with curl and c++ in xcode
我试图使用REST将简单数据POST到Parse服务器,但不能这样做,以下是代码
#include<curl/curl.h>
curl -X POST
-H "X-Parse-Application-Id: xxxxxxxxxx"
-H "X-Parse-REST-API-Key: xxxxxxxxxxxx"
-H "Content-Type: application/json"
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}'
https://api.parse.com/1/classes/GameScore
这里的X是什么?我们需要定义x吗?需要使用哪些连接设置才能成功发布数据?哪里是返回对象是Json,在哪里是存储?
谢谢。
您试图在c++中使用终端命令,这将不起作用。X是curl的命令行选项。
下面是Curl使用c提交HTTP POST请求的基本示例,您应该能够根据自己的需要进行调整。
http://curl.haxx.se/libcurl/c/http-post.html相关文章:
- 如何使用Qt发送REST调用?
- C++库库尔如何发送FTP文件usign STOR和REST
- Microsoft C++ 用于图形 API 的 Rest SDK
- Visual C++ and REST API
- 如何使用 CPP REST SDK 实现 CAS(中央认证服务)?
- QT 和 JIRA Rest API: /rest/api/2/issue/createmeta 意外返回韩语的 iss
- 关于C++ REST SDK 和同步调用
- 在服务器上执行操作的正确和 REST 方式?
- 在C/C 接受JSON中创建REST Web服务
- 使用卡萨布兰卡(C++ REST SDK)的许可条款是什么?
- 用于连接在线 REST 服务器的 REST API
- visual C++ REST SDK a.k.a Casablanka
- C REST SDK(Casablanca) - 如何获得HTTP代理设置
- REST邮政请求与Chilkat Lib
- 如何将 JSON 数据发送到 REST API?
- 将编译器命令行转换为 CMakeLists.txt用于 Casablanca Rest SDK
- 使用 c++ 点燃的 REST 请求
- 使用 REST SDK 将图像从 OpenCV 3 发送到认知人脸 API C++
- C++ 如何从用户输入中读取第一个字符并忽略 rest(字符类型)
- QT REST客户端为Microsoft认知服务翻译器API获得身份验证令牌