3

有人可以告诉我我做错了什么吗?我的 JSON 数据是这样的:

{"product_id":512,"image_file":"http://wwww.mydomain.com/cdn/images/9789490693718.jpg"}

我通过 POST 请求将此数据发布到: https://my-demo-store.mybigcommerce.com/api/v2/products/512/images.json

我收到这样的错误:

[{"status":400,"message":"The JSON content provided as input is invalid. Please check your JSON syntax before trying again."}]

我做错了什么?

亲切的问候米哈尔

4

2 回答 2

1

"product_id:"是只读的。(不要将它包含在您的 JSON 数据中)image_file将链接到 POST 请求中使用的 id。

于 2015-10-06T22:49:57.967 回答
0

我的 cURL 命令如下所示:

curl.exe -k -s --request POST -u "shopuser:tokenkey" -H "Content-Type: application/json" -d '{"product_id": 512,"image_file":" http://www. Exhibitionsinternational.org/img/9789490693589.jpg "}' https://store-yjybvmp.mybigcommerce.com/api/v2/products/512/images.json

我不知道我做错了什么,我可以上传新产品但没有图片

于 2013-09-10T11:18:19.130 回答