您好,我需要通過 CURL 命令發送 JSON 格式,但出現錯誤。
curl --request POST "https://app.io/api/graphql?accountId=Xzg" --header "x-api-key: WHpnV=" --header "Content-Type: application/json" --data-raw "{applications(limit: 2) {nodes {name}}}"
所以有問題的部分是data-raw,雖然我已經在網上檢查過它是有效的 JSON。
--data-raw "{applications(limit: 2) {nodes {name}}}"
回復:
{"metaData":null,"resource":null,"responseMessages":[{"code":"DEFAULT_ERROR_CODE","level":"ERROR",
"message":"Unable to process JSON Unexpected character ('a' (code 97)):
was expecting double-quote to start field name","exception":null,"failureTypes":[]}]}
我嘗試了不同的方法來更改此請求資料,但沒有成功。有人可以幫助我如何更改此查詢,該查詢肯定是從某些應用程式生成的正確查詢。謝謝!
uj5u.com熱心網友回復:
解決方案:
--data-raw '{"query": "{applications(limit: 2) {nodes {name}}}" }'
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/321153.html
下一篇:如何以角度發送卷曲請求
