303 See Other: Form POST Measured in 7 HTTP Clients
What happens after a form submission?
What happens after a form submission?
Read the scope, then compare the entries below.
Measured on Linux (x86_64, kernel 7.0.0-34-generic) against a local test server, with curl 8.18.0, GNU Wget 1.25.0, Python urllib.request 3.12.13, Python Requests 2.34.2, Python HTTPX 0.28.1, Node.js fetch 20.20.2, Chromium (HTML form) 149.0.7827.55. Windows, macOS, Firefox, Safari, older versions and other settings were not measured.
- curl 8.18.0: after a 303, the request arrived at the new address as a GET without its body.
- GNU Wget 1.25.0: after a 303, the request arrived at the new address as a GET without its body.
- Python urllib.request 3.12.13: after a 303, the request arrived at the new address as a GET without its body.
- Python Requests 2.34.2: after a 303, the request arrived at the new address as a GET without its body.
- Python HTTPX 0.28.1: after a 303, the request arrived at the new address as a GET without its body.
- Node.js fetch 20.20.2: after a 303, the request arrived at the new address as a GET without its body.
- Chromium (HTML form) 149.0.7827.55: after a 303, the request arrived at the new address as a GET without its body.
How does the wording compare?
Consider the quoted passages alongside the comparison totals.
“It is primarily used to allow the output of a POST action to redirect the user agent to a different resource, since doing so provides the information corresponding to the POST response as a resource that can be separately identified, bookmarked, and cached.” — RFC 9110 §15.4.4
“Note: For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request. If this behavior is undesired, the 307 (Temporary Redirect) status code can be used instead.” — RFC 9110 §15.4.3
“Note: For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request. If this behavior is undesired, the 308 (Permanent Redirect) status code can be used instead.” — RFC 9110 §15.4.2
“The 307 (Temporary Redirect) status code indicates that the target resource resides temporarily under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI.” — RFC 9110 §15.4.8
- After a 301, of 7 measured clients: 7 arrived there as a GET without a body.
- After a 302, of 7 measured clients: 7 arrived there as a GET without a body.
- After a 307, of 7 measured clients: 6 arrived there as a POST with its body; 1 did not go to the new address.
- After a 308, of 7 measured clients: 6 arrived there as a POST with its body; 1 did not go to the new address.
What does your form expect at the next address?
Match your own goal with the guidance below.
If the form data has to reach the new address, answer with 307 or 308: in this measurement, whenever a client went on to the new address after a 307 or 308, a POST with its body arrived there; after a 301, 302 or 303, a GET without a body arrived.
If your code posts with Python's urllib.request, handle 307 and 308 yourself: in this measurement it raised an error instead of going to the new address.
Read the quoted note next to that guidance.
“Note: This status code is much younger (June 2014) than its sibling codes and thus might not be recognized everywhere.” — RFC 9110 §15.4.9
Line up your intended destination with the entries and the guidance above, then pick the redirect that fits your form.
Does a 303 redirect change POST to GET?
After a 303, of 7 measured clients: 7 arrived there as a GET without a body.