Skip to content

303 See Other

The server redirects the client to another URL that it must fetch with GET, typically after a form submission or other POST.

What 303 See Other means

303 is the clean way to do the Post/Redirect/Get pattern. After a form submit, the server replies 303 with a Location pointing to a result page, and the browser loads it with GET. Refreshing that page then does not resubmit the form.

Unlike 302, a 303 always means switch to GET (a HEAD request stays HEAD). Use 307 when the method has to stay the same.

Headers that go with it

  • Location

Example response

HTTP/1.1 303 See Other
Location: https://example.com/new-page
Content-Type: text/plain; charset=utf-8

303 See Other

How to check for a 303 response

cURL

# Print only the status code (no -L, so the redirect isn't followed)
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/

JavaScript (Node.js)

const res = await fetch("https://example.com/", { redirect: "manual" });
if (res.status === 303) {
  console.log(res.status, res.statusText, res.headers.get("location"));
}

Python

import requests

res = requests.get("https://example.com/", allow_redirects=False)
if res.status_code == 303:
    print(res.status_code, res.reason, res.headers.get("Location"))

Go

client := &http.Client{
	CheckRedirect: func(*http.Request, []*http.Request) error {
		return http.ErrUseLastResponse
	},
}
res, err := client.Get("https://example.com/")
if err != nil {
	log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode == 303 {
	fmt.Println(res.Status, res.Header.Get("Location"))
}

Specification

303 See Other is defined in RFC 9110, section 15.4.4.

  • 302

    Found

    The resource is temporarily at a different URL. Clients follow the Location header but keep using the original URL in future.

  • 307

    Temporary Redirect

    The resource is temporarily at another URL, and the client must repeat the exact same request there, keeping the method and body.

  • 201

    Created

    The request worked and created a new resource. The Location header usually points to the URL of the new item.

← all 63 HTTP status codes

Type to search posts, tools and projects.

Keyboard shortcuts

Search+Kor/
Go to homegthenh
Go to bloggthenb
Go to projectsgthenp
Go to timelinegthent
Show this help?
Close search or helpesc