【发布时间】:2019-12-31 18:51:31
【问题描述】:
我正在尝试使用 google pagespeed 洞察力测试网站。有一个简单的 GET 方法可以使用 google pagespeed insight API 进行测试。我正在尝试自动化该过程,并且我正在使用简单的休息模板。当我在本地运行我的应用程序时,它工作得非常好,在使用 Postman 或只是从 Chrome 浏览器请求时也是如此。问题是当我尝试从我的 AWS 服务器请求数据时。然后它返回一个错误。这是一个示例请求。
https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=https://www.infojobs.net
我尝试添加不同的标题等,但问题非常特殊,因为当我尝试向邮递员请求时,没有额外的标题。
{
"error": {
"errors": [
{
"domain": "lighthouse",
"reason": "lighthouseError",
"message": "Lighthouse returned error: ERRORED_DOCUMENT_REQUEST.
Lighthouse was unable to reliably load the page you requested.
Make sure you are testing the correct URL and that the server is
properly responding to all requests. (Status code: 405)"
}
],
"code": 500,
"message": "Lighthouse returned error: ERRORED_DOCUMENT_REQUEST.
Lighthouse was unable to reliably load the page you requested. Make sure
you are testing the correct URL and that the server is properly responding
to all requests. (Status code: 405)"
}
}
我知道这不是一个严格的代码问题,但我已经想不出如何解决这个问题以及可能是什么问题。由于网站实际上已经过测试,因此不是网站本身的问题。
【问题讨论】:
标签: rest pagespeed google-pagespeed pagespeed-insights