The request returned an invalid status code of 401.
来源:1-2 课程导学

慕设计5218244
2023-10-17
我在用dio进行get请求的时候,报The request returned an invalid status code of 401.错误,使用以下代码依然报同样错误,是什么原因?怎么解决?
var dio = Dio();
dio.options.headers["Authorization"] =
"Basic <对应 token>"; //这个token值没有错误,这个很确定
dio.options.headers["Accept"] = "*/*";
Response response = await dio.get("请求地址");
写回答
1回答
-
CrazyCodeBoy
2023-10-18
这说明请求的接口需要登陆校验才能访问。022023-10-19
相似问题