【问题标题】:Public API returns 403 on Postman and terminal but works on browser公共 API 在 Postman 和终端上返回 403,但在浏览器上有效
【发布时间】:2021-07-28 10:04:44
【问题描述】:

我一直在尝试将此端点用于个人项目:

获取https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id=512&date=06-05-2021

我的问题是它在 Postman 以及当我使用 curl 或 wget 时返回 403 错误,但在 chrome 上工作正常。

rhis 有什么解决方案吗?为什么会这样?

【问题讨论】:

    标签: api https axios amazon-cloudfront


    【解决方案1】:

    尝试在您的请求中添加标头。

    标题 = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36'}

    【讨论】:

      猜你喜欢
      • 2016-06-17
      • 1970-01-01
      • 1970-01-01
      • 2021-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-16
      相关资源
      最近更新 更多