I have a 3rd party service where I send a request and get 301 redirect response back with a link to a pdf file.
What I want to do is send the request to the 3rd party service, then read the response header (dont want to be redirected), read the location header response and work with that.
Here is an example of the response
HTTP/1.1 301 Moved Permanently
< Date: Tue, 10 May 2022 08:27:08 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 421
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Location: https://s3.amazonaws.com/service/path/accounts/333/documents/20211119.pdf
< Vary: Origin
I want to read that Location response. I canโt seem to figure out how to do this. Any suggestions?