contentful - 使用 Contentful REST API 获取包含图像的所有条目
问题描述
我正在使用 typescript 和 Contentful-ManagementAPI(这就是我不使用 SDK 客户端的原因),并且我想从特定类型中检索所有条目。我这样称呼 Api:
axios.get("https://api.contentful.com/spaces/" +
space_id +
"/entries?content_type=" +
content_type+"&include="+2)
我收到了所有请求的条目,但在图像字段中我得到了这个:
poster:en-US:
sys:
{type: "Link", linkType: "Asset", id: "222xxm9aaAu4GiAc2ESw0Q"}
那么,我怎样才能获得图像 URL?我将不胜感激任何帮助。谢谢
解决方案
来自内容丰富的文档:
CMA 不支持 include 和 locale 参数。
所以,我可能会更好地使用交付 api 来检索内容,使用管理 api 来创建/更新/删除。这就是它应该使用的方式。
推荐阅读
- c# - 尝试通过 odata ws 更新/删除实体的异常
- tfs - TFS 2015 视图内容不显示任何代码
- redux - 还原 | 异步 | 无法弄清楚为什么调度功能不起作用
- android - 2 路数据绑定与 ViewModel-SavedState
- java - Fragment 中的数据即使在完成活动后也会保存其价值
- python - 如何让 pytest2 和 pytest3 同居?
- sql - 有没有办法在没有值占位符的情况下动态输入 SQL 查询的值
- github - 在 GitHub 页面上使用 Jekyll 不显示 MathJax 方程编号
- r - 将每一行除以一个常数并创建一个新列
- jekyll - 如何在 Liquid 中向数组添加新变量