我使用C#调用解析api并尝试执行基本的批量创建操作给我这个错误
"{"code":107,"error":"Method 'POST' to '/1/classes/NewObject/' not supported in batch operations."}
我尝试将我的方法更改为PUT,但错误只是更改为
"{"code":107,"error":"Method 'PUT' to '/1/classes/NewObject/' not supported in batch operations."}
NewObject 已作为我的Parse应用程序中的类存在,并且已经有一条我通过REST API创建的记录
修改 来自c#观察者的我的请求参数
[0] {Accept=application/json} RestSharp.Parameter
[1] {X-Parse-Application-Id=XXXXXXXXXXXXXXXXXXXXX} RestSharp.Parameter
[2] {X-Parse-REST-API-Key=XXXXXXXXXXXXXXXXXXX} RestSharp.Parameter
[3] {application/json={"requests":[{"method":"POST","path":"/1/classes/NewObject/","body":{"name":"luke","element":"Fir"}},{"method":"POST","path":"/1/classes/NewObject/","body":{"name":"tsitsi","element":"qwee"}}]}} RestSharp.Parameter
答案 0 :(得分:1)
检查http请求正文中的json
是否格式正确,因为Parse.com REST Api支持批量操作POST
。请在您的问题中添加您尝试执行的详细http请求。尝试从路径对象中删除尾部斜杠/
。样品:
{
"requests": [
{
"method": "POST",
"path": "/1/classes/NewObject",
"body": {
"name": "luke",
"element": "Fir"
}
},
{
"method": "POST",
"path": "/1/classes/NewObject",
"body": {
"name": "tsitsi",
"element": "qwee"
}
}
]
}