HTTP Status 303 - See Other

Der HTTP-Status-Code 303 See Other instruiert den Client, das Result der Operation mit einem GET-Request von der angegebenen URI abzurufen. Typischerweise nach POST-Requests verwendet, um POST-Redirect-GET-Pattern zu implementieren. Verhindert versehentliche Duplicate Submissions.

Typ

Response-Status-Code

Syntax

Der Status Code wird nach POST/PUT/DELETE mit Location Header zurückgegeben.

http
HTTP/1.1 303 See Other
Location: /result-page

Direktiven

Der 303 See Other Status Code wird für POST-Redirect-GET Pattern verwendet.

POST-Redirect-GET
Nach erfolgreicher Form Submission (POST) antwortet Server mit 303 und Location zur Result-Page. Browser führt GET auf diese URL aus, Result-Page wird angezeigt.
Method Change to GET
Client muss zwingend GET verwenden für Redirect-Request, unabhängig von Original-Methode. Unterscheidet sich von 302, wo Method-Change optional ist.
Prevent Duplicate Submissions
Browser-Refresh auf Result-Page führt zu GET-Request (safe Operation) statt POST-Resubmission. Verhindert versehentliche Duplicate Submissions (Orders, Payments, Data-Inserts).

Beispiele

Nachfolgend finden Sie praktische Anwendungsbeispiele für Status 303.

Beispiel 1 Form Submission Redirect

http
POST /orders HTTP/1.1
Host: shop.example.com
Content-Type: application/x-www-form-urlencoded

product_id=42&quantity=2

HTTP/1.1 303 See Other
Location: /orders/789/confirmation

Beispiel 2 Payment Processing Result

http
POST /payments/process HTTP/1.1
Host: payment.example.com
Content-Type: application/json

{"amount": 99.99, "card_token": "tok_123"}

HTTP/1.1 303 See Other
Location: /payments/pmt-xyz/receipt
Set-Cookie: payment_completed=1; Max-Age=300

Beispiel 3 Resource Upload Confirmation

http
POST /api/documents HTTP/1.1
Host: api.example.com
Content-Type: multipart/form-data

[file upload data]

HTTP/1.1 303 See Other
Location: /api/documents/doc-abc-123

POST-Redirect-GET Flow

303 See Other implementiert POST-Redirect-GET zur Vermeidung von Duplicate Submissions

Vorteile für die Systemarchitektur

  • Duplicate Prevention: Browser-Refresh führt zu GET statt POST-Resubmission. Verhindert versehentliche Duplicate Orders, Payments, Comments bei User-Refresh.
  • Bookmarkable Results: Result-URL kann gebookmarked und geshared werden. User kann direkt zu Order-Confirmation-Page zurückkehren ohne Form-Resubmission.
  • Clean Browser History: Browser-History enthält Result-Page-URL statt POST-Request. Back-Button funktioniert intuitiv ohne Resubmission-Warnings.

Spezifikation

RFC 9110, Section 15.4.4 – HTTP Semantics https://www.rfc-editor.org/rfc/rfc9110.html#name-303-see-other

Weitere Spezifikationen

HTTP Status 302 - Found, Location Header, GET Method