Suppose I use ajax (e.g. via jQuery) to do POST request to an API that implements a PRG pattern. Hence it will redirect me:
POST /some/api
HTTP/1.1 303 See Other
Location: /some/other/location
jQuery will then automatically follow the redirect and perform a:
GET /some/other/location
And then call the response handlers (success, failure, etc) with the output from the latter request. However, how can I read the location of the final resource (/some/other/location
in this case) in javascript?