0

I have a url that redirects to a different url. I would like to see what status code the URL redirects with (if it's a temporary redirect, or a permanent redirect / 301 / 302 / 307 etc.)

const axios = require("axios");

axios.get("https://www.someurl.com/with/a/redirect").then((resp) => {
  console.log(resp);
});

I am a bit stuck as to where to see this in the axios response? I only always see status code 200?

antonwilhelm
  • 5,768
  • 4
  • 19
  • 45
  • Does this answer your question? [How do I determine the status code of a Fetch request?](https://stackoverflow.com/questions/46004103/how-do-i-determine-the-status-code-of-a-fetch-request) – Adam Sep 17 '22 at 22:13

0 Answers0