Drupal Services空字段是数组

时间:2017-12-15 08:26:55

标签: drupal drupal-7

我的Drupal7服务7.x-3.20存在问题。 当我这样称呼时:

http://localhost.dd:8083/api/node/160.json
{
"vid": "160",
"uid": "9",
"title": "Title",
"log": "",
"status": "1",
"comment": "0",
"promote": "0",
"sticky": "0",
"nid": "160",
"type": "page",
"language": "de",
"created": "1513090483",
"changed": "1513090483",
"tnid": "0",
"translate": "0",
"revision_timestamp": "1513090483",
"revision_uid": "9",
"body": [],
"field_images": [],
"name": "admin",
"picture": "0",
"data": "a:1:{s:7:\"overlay\";i:1;}",
"path": "http://localhost.dd:8083/node/160"
}

当正文和场图像为空时,其余部分发送空数组[]。 如果该字段不为空,则它发送Object:

{
...
"body":  {
    "und": [
        {
        "value": "Test ....",
        "summary": "",
        "format": "filtered_html",
        "safe_value": "<p>Test ....</p>\n",
        "safe_summary": ""
        }
    ]
},
"field_images": [],
"name": "admin",
"picture": "0",
"data": "a:1:{s:7:\"overlay\";i:1;}",
"path": "http://localhost.dd:8083/node/160"
}

我该如何解决?我需要空对象{}

谢谢!

0 个答案:

没有答案