Want to send the bearer token with axios? The first parameter is the URL. The second is the JSON body that will be sent along your request.
1 2 3 4 5 6 7 8 9 10 11 12 13 | const config = { headers: { Authorization: `Bearer ${token}` } }; const bodyParameters = { key: "value" }; Axios.post( 'http://localhost:8000/api/v1/get_token_payloads', bodyParameters, config ).then(console.log).catch(console.log); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.