首页 > 解决方案 > Https GET req 在邮递员中运行良好,但不适用于 curl

问题描述

我必须对给定的 url 发出 GET 请求,我正在使用带有 axios 的 nodejs,这在 localhost 上运行良好,但是当部署到 heroku 时它会中断并总是返回 403 响应。它也适用于邮递员,但是当我从中生成 curl 代码并再次尝试时,我得到 403。所以总的来说,它只适用于本地和邮递员。

'https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id=312&date=12-05-2021'
const URL = "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id=312&date=12-05-2021"
const response = await axios.get(URL);

我也需要它在heroku上工作。

标签: node.jscurlherokuhttpspostman

解决方案


推荐阅读