103 Early Hints
Fault: Neither
TL;DR
Allows the server to send preliminary response headers while it prepares the full response.
Used to return some response headers before final HTTP message.
What This Error Means
Used to return some response headers before final HTTP message.
Allows the server to send preliminary response headers while it prepares the full response.
Common Causes
- Server sending Link headers for preloading resources
- Performance optimization
How to Fix It (For Visitors)
- This is not an error - performance optimization in progress
How to Fix It (For Developers/Admins)
- Use to preload critical resources
- Send Link headers for CSS, JS, fonts
Code Examples
Here's how to return a 103 status code in various programming languages:
Python (Flask)
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/endpoint')
def endpoint():
return jsonify({"message": "Early Hints"}), 103
Node.js (Express)
const express = require('express');
const app = express();
app.get('/endpoint', (req, res) => {
res.status(103).json({ message: 'Early Hints' });
});
PHP
<?php
http_response_code(103);
header('Content-Type: application/json');
echo json_encode(['message' => 'Early Hints']);
?>
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(103)
json.NewEncoder(w).Encode(map[string]string{
"message": "Early Hints",
})
}
Java (Spring Boot)
@GetMapping("/endpoint")
public ResponseEntity<Map<String, String>> endpoint() {
Map<String, String> response = new HashMap<>();
response.put("message", "Early Hints");
return ResponseEntity.status(103).body(response);
}
Ruby (Sinatra)
get '/endpoint' do
status 103
json message: 'Early Hints'
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 8297.