As for axios to Response Headers?

You need to get the headers of the request. Normal
xhr.getAllResponseHeaders() works, but for axios is it?

5c9b3a5f43acb873680709.png
March 19th 20 at 08:48
1 answer
March 19th 20 at 08:50
Solution
The documentation tried to read?
A complete answer of course. Read the entire manual at this link and found a lot of information on the expanse, but what I need is not there.
axios works on XMLHttpRequest, but no direct access method "getAllResponseHeaders"
May be you can help reach this method, which is underlined in red in the screenshot, I can't.
I tried different ways to type
"axios.defaults" "response.headers" and stuff like that

5c9b544b1d5b0522825136.jpeg - Caitlyn24 commented on March 19th 20 at 08:53
@Caitlyn24,
A complete answer of course.

More than.

Read the entire manual at this link and found a lot of information on the expanse, but what I need is not there.

I can only sympathize with you, but everything is there:
axios.get('/somePath').then(res => console.log('headers', res.headers));


May be you can help reach this method, which is underlined in red in the screenshot, I can't.

It makes no sense, as res.it is more convenient to use headers headers stacked into an object. But if you so wish:
axios.get('/somePath')
 .then(res => console.log('XHR response headers', res.request.getAllResponseHeaders());

It is strange that you, having the structure of the response object, do not understand how to call this method yourself.
Perhaps you should pull up the basics of JavaScript. - Nellie_Gerhold commented on March 19th 20 at 08:56
@Nellie_Gerhold, it helped. Thank you. - Caitlyn24 commented on March 19th 20 at 08:59

Find more questions by tags JavaScriptAJAX