303 See Other
Fault: Neither
TL;DR
Redirect to another resource using GET method.
The response to the request can be found at another URL using GET.
What This Error Means
The response to the request can be found at another URL using GET.
Redirect to another resource using GET method.
Common Causes
- POST/PUT/DELETE redirect to GET resource
- Form submission redirect
How to Fix It (For Visitors)
- Browser should automatically redirect
How to Fix It (For Developers/Admins)
- Use after POST to redirect to GET resource
- Prevents form resubmission
Code Examples
Here's how to return a 303 status code in various programming languages:
Python (Flask)
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/endpoint')
def endpoint():
return jsonify({"message": "See Other"}), 303
Node.js (Express)
const express = require('express');
const app = express();
app.get('/endpoint', (req, res) => {
res.status(303).json({ message: 'See Other' });
});
PHP
<?php
http_response_code(303);
header('Content-Type: application/json');
echo json_encode(['message' => 'See Other']);
?>
Go
package main
import (
"encoding/json"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(303)
json.NewEncoder(w).Encode(map[string]string{
"message": "See Other",
})
}
Java (Spring Boot)
@GetMapping("/endpoint")
public ResponseEntity<Map<String, String>> endpoint() {
Map<String, String> response = new HashMap<>();
response.put("message", "See Other");
return ResponseEntity.status(303).body(response);
}
Ruby (Sinatra)
get '/endpoint' do
status 303
json message: 'See Other'
end
Browser Compatibility
| Browser | Support | Notes |
|---|---|---|
| Chrome | ✓ Full Support | All versions |
| Firefox | ✓ Full Support | All versions |
| Safari | ✓ Full Support | All versions |
| Edge | ✓ Full Support | All versions |
Official Specification
This status code is defined in RFC 7231 Section 6.4.4.