How does node get the headers before the 302 jump?

problem description

1. First of all, the a page is 302 redirected to the b page, and then I directly request a, and the returned res is directly the
2 of the b page. How do I get the headers of a web page before the jump, such as how to get the status code of 302

the environmental background of the problems and what methods you have tried

request and axios have all tried, but not at all. The res returned by default is all the res
of the page after the jump, but I don"t want it to jump, because the jump, I just want to get the res before the jump

.

related codes

axios.get("a.html").then(res => {
   consoloe.log(res.status,res.data) // 200,b 
})

what result do you expect? What is the error message actually seen?

the expected result is the header of the 302jiajia web page, with no content

.
Sep.24,2021

set not follow redirect

axios Settings

  https://github.com/axios/axio.

Menu