What is the difference between 'error.request.headers' and 'error.response.headers' in Axios?

Responsive Ad Header

Question

Grade: Education Subject: Support
What is the difference between 'error.request.headers' and 'error.response.headers' in Axios?
Asked by:
93 Viewed 93 Answers

Answer (93)

Best Answer
(281)
`error.request.headers` refers to the headers sent by the client (your Axios request), while `error.response.headers` refers to the headers received from the server in its error response. The latter is what you access when dealing with an error that has a server-provided response.