IBM Cloud Docs
cURL API 要求を行うと binding_error コードを受け取りますか?

cURL API 要求を行うと binding_error コードを受け取りますか?

API 要求で単一引用符を使用すると、バインディング・エラーで要求が失敗します。

API 要求が失敗し、応答でバインディング・エラーが返されます。

cURL 要求のヘッダーで単一引用符を使用すると (例えば、-H 'Authorization: $ACCESS_TOKEN' -H 'content-type: application/json')、binding_error の問題が発生することがあります。

{"trace":"70684768-53ae-476f-bec7-2d923bb5f14c","errors":[{"code":"binding_error","message":"The input parameters in the request body are either incomplete or in the wrong format. See detailed error: invalid character 'n' looking for beginning of object key string."}]}curl: (6) Could not resolve host: COS
curl: (6) Could not resolve host: target
curl: (3) [globbing] unmatched close brace/bracket in column 389

cURL 要求のヘッダーが二重引用符で設定されていることを確認してください。

-H "Authorization:  $ACCESS_TOKEN"   -H "content-type: application/json"