解析批量上传API,错误代码107是什么意思?

时间:2014-06-30 16:52:18

标签: parse-platform

为什么我不能使用Parse批量导入API添加对象?

curl -X POST \
  -H "X-Parse-Application-Id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "X-Parse-REST-API-Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{
   "requests":[
      {
         "method":"POST",
         "path":"1/classes/Store",
         "body":{
            "storeNumber":3466,
            "storeLocation":{
               "__type":"GeoPoint",
               "latitude":-88.481369,
               "longitude":44.263837
            },
            "storeAddress":"4733 W. GRANDE MARKET DR. GRAND CHUTE  WI 54913 US"
         }
      },

...

      {
         "method":"POST",
         "path":"1/classes/Store",
         "body":{
            "storeNumber":119,
            "storeLocation":{
               "__type":"GeoPoint",
               "latitude":-122.171134,
               "longitude":37.444756
            },
            "storeAddress":"165 STANFORD SHOPPING CTR PALO ALTO  CA 94304-1409 US"
         }
      }
   ]
}' \
  https://api.parse.com/1/batch

{"代码":107,"错误":"方法' POST'到' 1 / classes / Store'批处理操作不支持。"}

我创建了一个'商店'具有匹配列名称/类型的对象,但可以使用批处理API的任何行。

1 个答案:

答案 0 :(得分:0)

通过查看文档,我猜是因为您的path无效。

你需要额外的" /"在前面,所以/1/classes/Store代替1/classes/Store