Angular 从对Drupal的API调用获取关系

Angular 从对Drupal的API调用获取关系,angular,drupal-8,json-api,Angular,Drupal 8,Json Api,我正在尝试将Drupal设置为一个无头CMS,使用它向一个角度应用程序提供数据。我可以从get请求中获取响应对象,但响应数据不包括任何引用字段类型(例如图像或标记)。相反,它返回一个包含引用字段类型的关系对象 响应对象示例: "data": { "type": "node--release", "id": "21bff999-241d-4807-bd00-4af7f5a767ff", "attributes": { "nid": 11, "uuid": "21bff9

我正在尝试将Drupal设置为一个无头CMS,使用它向一个角度应用程序提供数据。我可以从get请求中获取响应对象,但响应数据不包括任何引用字段类型(例如图像或标记)。相反,它返回一个包含引用字段类型的关系对象

响应对象示例:

"data": {
  "type": "node--release",
  "id": "21bff999-241d-4807-bd00-4af7f5a767ff",
  "attributes": {
    "nid": 11,
    "uuid": "21bff999-241d-4807-bd00-4af7f5a767ff",
    "vid": 11,
    "title": "Example title",
    "created": 1506621775,
    "changed": 1506621912,
    "revision_timestamp": 1506621912,
    "revision_log": null,
    "path": null,
    "field_artist": "Band name",
    "field_description": {
      "value": "<p>Album description</p>\r\n",
      "format": "basic_html"
    },
    "field_title": "Album name",
  },
  "relationships": {
    "field_image_large": {
      "data": {
        "type": "file--file",
        "id": "83d45147-1339-45a0-ae8e-fc662575d77b",
      },
      "links": {
        "self": "http://localhost/error-records/jsonapi/node/release/21bff999-241d-4807-bd00-4af7f5a767ff/relationships/field_image_large",
        "related": "http://localhost/error-records/jsonapi/node/release/21bff999-241d-4807-bd00-4af7f5a767ff/field_image_large"
      }
    },
  },
} 
“数据”:{
“类型”:“节点——发布”,
“id”:“21bff999-241d-4807-bd00-4af7f5a767ff”,
“属性”:{
“nid”:11,
“uuid”:“21bff999-241d-4807-bd00-4af7f5a767ff”,
“视频”:11,
“标题”:“示例标题”,
“已创建”:1506621775,
“更改”:1506621912,
“修订时间戳”:1506621912,
“修订日志”:空,
“路径”:空,
“现场艺术家”:“乐队名称”,
“字段描述”:{
“值”:“相册说明”

\r\n”, “格式”:“基本html” }, “字段标题”:“专辑名称”, }, “关系”:{ “字段\图像\大”:{ “数据”:{ “类型”:“文件--文件”, “id”:“83d45147-1339-45a0-ae8e-fc662575d77b”, }, “链接”:{ “自我”:http://localhost/error-records/jsonapi/node/release/21bff999-241d-4807-bd00-4af7f5a767ff/relationships/field_image_large", “相关”:http://localhost/error-records/jsonapi/node/release/21bff999-241d-4807-bd00-4af7f5a767ff/field_image_large" } }, }, }
我想显示上传到“field_image_large”的图像,但没有直接指向图像存储位置的链接(既不是自身链接,也不是相关链接)。此外,当我对其中任何一个进行API调用时,返回的结果也不会提供指向图像存储位置的链接。

您可以这样做
GET/jsonapi/node/release/{resourceID}?include=field\u image\u large
在[0]包含的
链接中,您将找到一个图像路径。
顺便说一下,有了一堆模块,你甚至可以得到响应迅速的图像。其中之一是。关于它的更多信息,你可以在上面提到的链接中找到