我正在研究Axiosget in the react,这需要授权。在我添加authorization之前,它工作得很好,在我在后台和前端添加authorization header之后,它出现了CORS错误。我在邮递员中尝试了get呼叫,它非常有效。所以我认为Axios应该在前端获得代码。let AuthStr = 'token';
console.log(typeof(AuthStr)); => the type i
我正在使用reactJs,在尝试将authorization标头从我的登录页面传递到我的主页this is my index.js时,我得到了一个401未授权的Authorization: Bearerundefined import React from 'react';import App from './App';
impor
当使用Axios/http请求设置头时,我在向服务器发出get请求时遇到问题。我添加的任何标头(除content-type标头外)都会导致相同的错误:"Response for preflight status code405无效。具体地说,我需要为我需要连接的服务添加帐户验证的Authorization头。
使用API URI在Postman上运行GET请求可以很好地工作,并且我会得到所需的响应