@delpha
To capture a redirect response header, you can use a tool like cURL or a programming language such as Python. Here are the steps to capture the redirect response header using cURL:
1
|
curl -D - -L <URL> |
Replace <URL>
with the actual URL you want to make the request to.
You will see the response headers, including the redirect response header, displayed in the command prompt or terminal window.
If you are using a programming language like Python, you can use libraries like requests
or urllib
to retrieve the redirect response header. Here's an example using the requests
library:
1 2 3 4 5 6 |
import requests response = requests.get('<URL>', allow_redirects=True) redirect_headers = response.history[0].headers if response.history else response.headers print(redirect_headers) |
Replace <URL>
with the actual URL you want to make the request to. The allow_redirects=True
parameter allows requests to follow redirects. The example prints the redirect response headers to the console.