node.js - 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上工作。
解决方案
推荐阅读
- java - 从 EditText 字段获取输入并保存在变量中
- python - 在 odoo 11 中的产品表单邮件线程上发布消息
- javascript - 如何将html字符串转换为dataURI
- javascript - 在 Reactjs 中的 Firebase 中插入数据
- spring - 寻找蓝图 XML 命名空间引用。(从 Spring XML 迁移。)
- javascript - .load() 整个页面到模态和 .remove() 特定的 div 同时使用 JQuery
- java - 从 Java Lambda 访问 Cloudformation 参数
- angular - *ngIf async pipe angular 与另一个 observable 合并
- python - 基于 Python 中的列表和字典对多列进行编码
- c# - 为什么修改数据库数据的查询可以等待,而只读取数据的查询不能?