score:5

Accepted answer

your assumption is wrong you can set the headers in the request config

https://github.com/axios/axios#request-config

{
   headers: {'X-Requested-With': 'XMLHttpRequest'},
   ...
}

score:7

base on doc

you can set header in config !

axios.post(url, data, {headers : {'X-Requested-With': 'XMLHttpRequest'} })

or you can send all options as a object

axios.request ({
    url: '/user',
    method: 'post',
    data: {
        firstName: 'Fred'
    },
    headers: {'X-Requested-With': 'XMLHttpRequest'},

    // ... and other options 
})

Related Query

More Query from same tag