node reqeust 可以正常get,放在electron下就不能get到数据了

const request = require('request')
request('https://www.xxx.cn/front/detail/item/36788268?timestamp=1592492065017', function (error, response, body) {
    console.log('teet', error, response)
})

上面代码放在nodejs中可以执行,并且有返回结果。

放在electron中就会报405错误了

是electron什么设置影响到nodejs 的 request吗?

GET https://www.xxxx.cn/front/detail/item/36788268?timestamp=1592492065017 405 (Method Not Allowed)
阅读 2k
1 个回答

跨域了has been blocked by CORS policy

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题