Sending the bearer token with axios
问题 In my react app i am using axios to perform the REST api requests. But it's unable to send the Authorization header with the request. Here is my code: tokenPayload() { let config = { headers: { 'Authorization': 'Bearer ' + validToken() } } Axios.post( 'http://localhost:8000/api/v1/get_token_payloads', config ) .then( ( response ) => { console.log( response ) } ) .catch() } Here the validToken() method would simply return the token from browser storage. All requests are having a 500 error