你好,代码怎么写的?

 https://api.leancloud.cn/1.1/classes/DatingItem?include=master

我有一个class叫DatingItem,有个叫master的字段通过pointer指向_User的某一行
我在postman里测试,这是返回数据:

{
  "results": [
    {
      "hasDated": false,
      "updatedAt": "2016-08-15T07:52:06.015Z",
      "promulgatorId": "",
      "content": "快来约我~~~",
      "promulgator": "",
      "objectId": "57b02f507db2a20054238cb3",
      "photoSrc": "",
      "createdAt": "2016-08-14T08:44:00.743Z",
      "promulgatorPhosrc": "null",
      "title": "null",
      "theme": "快来约",
      "promulgatorPhoto": "null",
      "receiverId": "",
      "receiverPhoto": "null",
      "master": {
        "salt": "amtlxcd7t11o08lonugc8gnnpl20xsx380qdizts8lj91zyj",
        "sessionToken": "ykd3f7dunv57sj8x1nz579gqd",
        "updatedAt": "2016-08-08T05:04:49.351Z",
        "ACL": {
          "*": {
            "write": true,
            "read": true
          }
        },
        "password": "hxfYplh/DofojgU1CdoNC/soBVkFbh6Y3SRQTgpZHoyHOaDbffGDH2HsZ4LLspM+xgTST739uZcU4HyZws/qcA==",
        "objectId": "57a812f1a341310063428249",
        "username": "acemurder",
        "createdAt": "2016-08-08T05:04:49.351Z",
        "emailVerified": false,
        "mobilePhoneVerified": false
      },
      "receiver": ""
    }
  ]
}

可以看到,通过

          https://api.leancloud.cn/1.1/classes/DatingItem?include=master

来获取的话,是获取不到_User的自定义属性的,我的权限都是设置了public,所有属性对客户端都是可见的,完整的_User属性

{
  "description": "这个人很懒,什么都没有留下!",
  "ACL": {
    "*": {
      "read": true,
      "write": true
    }
  },
  "photoSrc": "null",
  "username": "acemurder11",
  "emailVerified": false,
  "image": {
    "__type": "Pointer",
    "className": "Image",
    "objectId": "57b800665bbb50005b721f6c"
  },
  "authData": null,
  "mobilePhoneVerified": false,
  "objectId": "57b2b9c7a341310060fdf2a8",
  "createdAt": "2016-08-16T06:59:19.996Z",
  "updatedAt": "2016-08-22T02:29:22.944Z"
}

请问你 App ID 是 ?include 查询后没出现的 _User 表自定义字段名是?

APP ID: vnRdeLMsUKJJFBOK4u4MtqBv-gzGzoHsz
所有的自定义字段都没出现:description(String),photoSrc(String),image(pointer)

我推测你传数据的格式不对。用以下 cURL 测试,没有问题:

  curl -X GET \
  -H "X-LC-Id: 你的 App ID" \
  -H "X-LC-Key: 你的 App Key" \
  -G \
  --data-urlencode 'include=master' \
  https://api.leancloud.cn/1.1/classes/DatingItem

没什么问题。我这边 postman 测试也是正常的。

不确定是不是 postman 的版本问题。

建议直接在命令行里用 cURL 来验证 API。