【发布时间】:2021-10-06 20:29:42
【问题描述】:
我需要使用 linode api,在描述中说我必须像这样使用 curl 发送数据
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"label": "asdfasdf"
"ssh_key": "asdfasdf"
}' \
https://api.linode.com/v4/profile/sshkeys
我尝试过使用
http = Faraday::Connection.new 'https://api.linode.com/v4/profile/sshkeys'
http.authorization :Bearer, token
http.post('', { 'label' => 'adfadf', ..}.to_json)
但是每个请求都说需要 label 和 ssh_key。我不知道如何发送这个特定的请求
有人吗?
【问题讨论】: