【发布时间】:2021-09-03 20:21:42
【问题描述】:
我有一些请求,我想在 libcurl 中使用它们。但我不知道该怎么做 那么我应该在“curl.get(dsds)curl.header(”“,”“)”之类的代码中实现这一点
curl "https://pterodactyl.file.properties/api/client/account" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer apikey' \
-X GET \
curl "https://pterodactyl.file.properties/api/client/account/email" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer apikey' \
-X PUT \
-d '{
"email": "example@xample.com",
"password": "Password"
}'
curl "https://pterodactyl.file.properties/api/client/account/api-keys" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer apikey' \
-X POST \
-d '{
"description": "Restricted IPs",
"allowed_ips": ["127.0.0.1", "192.168.0.1"]
}'
curl "https://pterodactyl.file.properties/api/client/account/api-keys/NWKMYMT2Mrav0Iq2" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer apikey' \
-X DELETE \
【问题讨论】:
-
创建一个程序来编译 libcurl 或链接它,然后通读文档和示例以了解如何提出这些请求。它们并不难,但如果您遇到问题,可以在这里提出这些具体问题。