D
D
DenniLa22020-05-06 19:20:50
JavaScript
DenniLa2, 2020-05-06 19:20:50

How to get response headers in axios?

I am faced with the task of extracting and answer headers the file name.
Here's what comes in:
5eb2e4382a6d2465970645.png
And this is the console.log(response) listing
5eb2e4442af30976338053.png
For some reason, there is no content-disposition in it
Tell me how to extract this header from the response

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2020-05-06
@Rsa97

This problem is most often related to CORS. The browser gives the client not all the headers.
If this is your service, then try adding the header
Access-Control-Expose-Headers: Content-Disposition
https://developer.mozilla.org/en-US/docs/Web/HTTP/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question