Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.5k views
Welcome To Ask or Share your Answers For Others

1 Answer

跨域了has been blocked by CORS policy


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...