Node.js WordPress.com API在本地工作,但不在应用程序引擎上工作

Node.js WordPress.com API在本地工作,但不在应用程序引擎上工作,node.js,http,google-app-engine,request,wordpress-rest-api,Node.js,Http,Google App Engine,Request,Wordpress Rest Api,通过请求模块调用Wordpress API。在本地运行服务器时,调用将正确返回。使用邮递员,url将正确返回 但是,当我将我的应用程序部署到Google app Engine时,请求调用中的响应返回undefined app.get('/api/test', (req, res) => { console.log("testing"); // res.send({ express: 'Hello From testing' }); request('https://public-

通过请求模块调用Wordpress API。在本地运行服务器时,调用将正确返回。使用邮递员,url将正确返回

但是,当我将我的应用程序部署到Google app Engine时,请求调用中的响应返回undefined

app.get('/api/test', (req, res) => {
  console.log("testing"); 
  // res.send({ express: 'Hello From testing' });
request('https://public-api.wordpress.com/rest/v1/sites/testblog.wordpress.com/posts', { json: true }, (err, response, body) => {
  console.log(response.statusCode)
  console.log(body); 
if (err) { return console.log(err); }
  console.log(body);
  res.send({ express: body.ID })
});
});

当应用程序引擎发出出站HTTPS请求获取URL时,它会检查请求URL的证书。如果由于任何原因证书无效,应用程序引擎将拒绝该请求。根据文档,将verify_peer的值设置为false

您还应该阅读有关获取URL的信息