微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Url get axios 在 react 和 postman 中工作,但在节点 Js 中给出 403 错误

如何解决Url get axios 在 react 和 postman 中工作,但在节点 Js 中给出 403 错误

我正在尝试在 node js 中使用 axios 进行 api 调用,但它给了我 403 错误,我不知道为什么

const http = require("http")
const axios = require("axios");
const app = http.createServer((req,res)=>{
    res.writeHead(200,{'Content-Type': 'application/json'});
})

const test = async() =>{
  const res = await axios.get("https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByPin?pincode=110017&date=10-05-2021")
  console.log(res)
}

test()
app.listen(4000,'127.0.0.1');
console.log('Node server running on port 4000')

Error Image

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。