你好夥伴堆棧器我一直在使用Parse.com API來獲取單個查詢中的關係對象。Parse.com REST API include聲明不起作用
根據官方documentation如果你想從你的查詢中檢索關係對象,你必須使用'include'語句,我會使用郵遞員嘗試它,並且我無法獲得我需要的結果。
URL請求
curl -X GET \
-H "X-Parse-Application-Id: PARSE-APP-ID" \
-H "X-Parse-REST-API-Key: PARSE-REST-KEY" \
-G \
--data-urlencode 'include=media, author' \
https://api.parse.com/1/Post/p0rKbcZOjX
此請求的結果總是帖子的全部數據與它的指針,但它不包括在所要求的相關項目的所有數據,包括
響應:
{
"author": {
"__type": "Pointer",
"className": "_User",
"objectId": "hZLoiIQE3O"
},
"content": "This is the new updated content!!",
"createdAt": "2014-05-15T19:01:39.235Z",
"media": {
"__type": "Pointer",
"className": "Media",
"objectId": "d62EHxZOhO"
},
"number": 237,
"objectId": "p0rKbcZOjX",
"text": "This is the updated Text!!",
"title": "My Post title",
"updatedAt": "2015-10-16T18:54:33.261Z"
}
的媒體和作者[R興高采烈的對象比那裏顯示的字段更多。任何幫助?提前致謝!
感謝您的回覆,我馬上就去測試一下! –