接口出现无法执行curl

问题描述:

路由能正常访问,但认证失败,

由于请求需要执行,curl -X GET "http://api.jr.com/v1/salary/list" -H "accept: application/json" -H "Authorization: Bearer 123456"

也就是需要执行curl命令失败,

Code Details
401
Undocumented
Error: Unauthorized
Response body
{
  "name": "Unauthorized",
  "message": "You are requesting with an invalid credential.",
  "code": 0,
  "status": 401,
  "type": "yii\\web\\UnauthorizedHttpException"
}

问题分析

解决方案

需要开启cgi

在appache配置中补充

CGIPassAuth on

到我的目录配置,

因为Apache正在隐藏授权头

猜你喜欢

转载自www.cnblogs.com/huay/p/10994887.html
今日推荐