Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

headers in axios.get

const axios = require('axios');

// httpbin.org gives you the headers in the response
// body `res.data`.
// See: https://httpbin.org/#/HTTP_Methods/get_get
const res = await axios.get('https://httpbin.org/get', {
  headers: {
    'Test-Header': 'test-value'
  }
});

res.data.headers['Test-Header']; // "test-value"
Source by masteringjs.io #
 
PREVIOUS NEXT
Tagged: #headers
ADD COMMENT
Topic
Name
6+6 =