twisted.web.test.test_agent._RedirectAgentTestsMixin(object)
class documentationtwisted.web.test.test_agent
(View In Hierarchy)
Known subclasses: twisted.web.test.test_agent.BrowserLikeRedirectAgentTests, twisted.web.test.test_agent.RedirectAgentTests
Test cases mixin for RedirectAgentTests
and BrowserLikeRedirectAgentTests
.
Method | test_noRedirect | client.RedirectAgent
behaves like client.Agent if the
response doesn't contain a redirect. |
Method | test_redirect301 | client.RedirectAgent
follows redirects on status code 301. |
Method | test_redirect302 | client.RedirectAgent
follows redirects on status code 302. |
Method | test_redirect307 | client.RedirectAgent
follows redirects on status code 307. |
Method | test_redirect303 | client.RedirectAgent
changes the method to GET when getting a 303 redirect on a
POST request. |
Method | test_noLocationField | If no Location header field is found when getting a
redirect, client.RedirectAgent
fails with a ResponseFailed
error wrapping a error.RedirectWithNoLocation
exception. |
Method | test_307OnPost | When getting a 307 redirect on a POST request, client.RedirectAgent
fails with a ResponseFailed
error wrapping a error.PageRedirect
exception. |
Method | test_redirectLimit | If the limit of redirects specified to client.RedirectAgent
is reached, the deferred fires with ResponseFailed
error wrapping a InfiniteRedirection
exception. |
Method | test_relativeURI | client.RedirectAgent
resolves and follows relative URIs in redirects, preserving query
strings. |
Method | test_relativeURIPreserveFragments | client.RedirectAgent
resolves and follows relative URIs in redirects, preserving
fragments in way that complies with the HTTP 1.1 bis draft. |
Method | test_relativeURISchemeRelative | client.RedirectAgent
resolves and follows scheme relative URIs in redirects, replacing
the hostname and port when required. |
Method | test_responseHistory | Response.response references the previous Response from a
redirect, or None
if there was no previous response. |
Method | _testRedirectDefault | When getting a redirect, client.RedirectAgent
follows the URL specified in the Location header field and
make a new request. |
Method | _testRedirectToGet | client.RedirectAgent
changes the method to GET when getting a redirect on a
non-GET request. |
Method | _testPageRedirectFailure | When getting a redirect on an unsupported request method, client.RedirectAgent
fails with a ResponseFailed
error wrapping a error.PageRedirect
exception. |
Method | _testRedirectURI | When client.RedirectAgent
encounters a relative redirect URI, it is resolved against the
request URI before following the redirect. |
client.RedirectAgent
behaves like client.Agent
if the
response doesn't contain a redirect.
When getting a redirect, client.RedirectAgent
follows the URL specified in the Location
header field and
make a new request.
Parameters | code | HTTP status code. |
client.RedirectAgent
changes the method to GET when getting a redirect on a
non-GET request.
Parameters | code | HTTP status code. |
method | HTTP request method. |
client.RedirectAgent
changes the method to GET when getting a 303 redirect on a
POST request.
If no Location
header field is found when getting a
redirect, client.RedirectAgent
fails with a ResponseFailed
error wrapping a error.RedirectWithNoLocation
exception.
When getting a redirect on an unsupported request method, client.RedirectAgent
fails with a ResponseFailed
error wrapping a error.PageRedirect
exception.
Parameters | code | HTTP status code. |
method | HTTP request method. |
When getting a 307 redirect on a POST request, client.RedirectAgent
fails with a ResponseFailed
error wrapping a error.PageRedirect
exception.
If the limit of redirects specified to client.RedirectAgent
is reached, the deferred fires with ResponseFailed
error wrapping a InfiniteRedirection
exception.
When client.RedirectAgent
encounters a relative redirect URI, it is resolved against the
request URI before following the redirect.
Parameters | uri | Request URI. |
location | Location header redirect URI. | |
finalURI | Expected final URI. |
client.RedirectAgent
resolves and follows relative URIs in redirects, preserving query
strings.
client.RedirectAgent
resolves and follows relative URIs in redirects, preserving
fragments in way that complies with the HTTP 1.1 bis draft.
See Also | https://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22#section-7.1.2 |
client.RedirectAgent
resolves and follows scheme relative URIs in redirects, replacing
the hostname and port when required.