如何使用PARSE库在Android保存多个对象 [英] How to save multiple objects using PARSE library from android

查看:146
本文介绍了如何使用PARSE库在Android保存多个对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid应用程序,我从Facebook运行FQL查询,得到用户的喜好,我想保存解析平台上的结果。
相反,单独保存每个对象是有办法使一批的要求吗?

On my Android application I'm getting the user's likes from facebook running an FQL query and I want to save the results on the PARSE platform. Instead of saving each object separately is there a way to make a batch request ?

推荐答案

使用解析REST API,你可以做批处理操作(创建,读取,更新,删除等)。

Using the Parse REST API, you can do batch operations (creating, reading, updating, deleting, etc).

下面是节约了几个对象的示例:

Here is an example of saving a couple objects:

curl -X POST \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
        "requests": [
          {
            "method": "POST",
            "path": "/1/classes/GameScore",
            "body": {
              "score": 1337,
              "playerName": "Sean Plott"
            }
          },
          {
            "method": "POST",
            "path": "/1/classes/GameScore",
            "body": {
              "score": 1338,
              "playerName": "ZeroCool"
            }
          }
        ]
      }' \
  https://api.parse.com/1/batch

查看的rel=\"nofollow\">批量操作部分获取更多信息。

See the Batch Operations section of the Parse REST API Guide for more information.

这篇关于如何使用PARSE库在Android保存多个对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆