0

How can I check the status code of a request? I want to check what kind of redirects were used to access a page.

For response objects I would use *response.status_code*

hoju
  • 24,959
  • 33
  • 122
  • 169

2 Answers2

2

There is no such thing as a status code of a request. You can use HTTP referer instead[1] or have the links include an HTTP parameter that identifies the source (e.g., ?src=example.com)

[1] http://en.wikipedia.org/wiki/HTTP_referer

schuppe
  • 2,033
  • 10
  • 10
1

I might be wrong but there is no such thing as incoming request status code, application doing requests in case of redirect gets 302 from initial request checks location and do another request. And history of incoming request in shape of thing like "traceroute" just don't exists in HTTP.

Jakub Oboza
  • 4,829
  • 1
  • 15
  • 9