接口报错401 Unauthorized
401 Unauthorized
This server could not verify that you are authorized to access the document you requested.
错误原因
状态码 401 Unauthorized 代表客户端错误,指的是由于缺乏目标资源要求的身份验证凭证,发送的请求未得到满足。
简单点说,身份验证凭证没通过,没有 token,或者 token不对。
解决方法
如果请求需要带token才能访问,检查一下token的参数名称、以及参数值是否都正确。
有些接口的token是放在url参数后面,有些接口的token是放在 cookie里面。
调用接口时,带上token即可。