diff options
| author | Lorenzo Peña <lorinkoz@gmail.com> | 2024-11-14 19:53:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-14 15:53:49 -0300 |
| commit | 91c879eda595c12477bbfa6f51115e88b75ddf88 (patch) | |
| tree | 544ce7be64975158b6d3f0d0a8ea693ab7188aca /docs/ref | |
| parent | 8590d05d44a4f3df56d988229e43d66c37df79da (diff) | |
Fixed #35784 -- Added support for preserving the HTTP request method in HttpResponseRedirectBase.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/request-response.txt | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index afebd00d8b..26fcb5fa08 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -1070,18 +1070,32 @@ types of HTTP responses. Like ``HttpResponse``, these subclasses live in (e.g. ``'https://www.yahoo.com/search/'``), an absolute path with no domain (e.g. ``'/search/'``), or even a relative path (e.g. ``'search/'``). In that last case, the client browser will reconstruct the full URL itself - according to the current path. See :class:`HttpResponse` for other optional - constructor arguments. Note that this returns an HTTP status code 302. + according to the current path. + + The constructor accepts an optional ``preserve_request`` keyword argument + that defaults to ``False``, producing a response with a 302 status code. If + ``preserve_request`` is ``True``, the status code will be 307 instead. + + See :class:`HttpResponse` for other optional constructor arguments. .. attribute:: HttpResponseRedirect.url This read-only attribute represents the URL the response will redirect to (equivalent to the ``Location`` response header). + .. versionchanged:: 5.2 + + The ``preserve_request`` argument was added. + .. class:: HttpResponsePermanentRedirect Like :class:`HttpResponseRedirect`, but it returns a permanent redirect (HTTP status code 301) instead of a "found" redirect (status code 302). + When ``preserve_request=True``, the response's status code is 308. + + .. versionchanged:: 5.2 + + The ``preserve_request`` argument was added. .. class:: HttpResponseNotModified |
