Answers for "fetch api get response headers and get authorization header"

1

fetch get authorization header

fetch('URL_GOES_HERE', { 
   method: 'post', 
   headers: new Headers({
     'Authorization': 'Basic '+btoa('username:password'), 
     'Content-Type': 'application/x-www-form-urlencoded'
   }), 
   body: 'A=1&B=2'
 });
Posted by: Guest on November-18-2021
0

how to access response headers in javascript fetch api

response.headers.get('x-auth-token')
Posted by: Guest on January-14-2022

Code answers related to "fetch api get response headers and get authorization header"

Code answers related to "Javascript"

Browse Popular Code Answers by Language