【发布时间】:2019-03-27 18:58:25
【问题描述】:
我对 Contentful 非常陌生,并试图从我的 Contentful 数据库中获取一种特定内容类型“公司”的所有项目,但我收到错误消息:
`400 Bad Request` response: { "sys": { "type": "Error", "id":
"InvalidQuery" }, "message": "The query you sent was invalid. Probably
a (truncated...) in
我的代码是:
$client = new Client($accessToken, $spaceID);
$query = new \Contentful\Delivery\Query();
$query->setContentType('hosting_companies');
$entries = $client->getEntries($query);
有人知道我可能会错过什么吗?
非常感谢!
【问题讨论】:
-
您可以通过捕获
GuzzleHttp\Exception\ClientException并在其上调用getResponse()->getBody()->getContents()来获得整个响应(未截断)。也许它会给你一个提示。
标签: php contentful