HTTP 425 Too Early (RFC 8470) indicates the server is unwilling to risk processing a request that might be replayed. This is specifically related to TLS 1.3 early data (0-RTT) — data sent in the first flight of a TLS handshake can be replayed by an attacker. Non-idempotent requests (POST, PUT, DELETE) sent as early data may be dangerous, so the server returns 425 to tell the client to retry after the full handshake completes.
Response includes the status code, standard headers (including Content-Type), and a small diagnostic JSON body describing the request and returned status.
Simulator URL (copy in the app after load — not a normal link):
https://httpstatus.com/api/status/425
Example request:
curl -i "https://httpstatus.com/api/status/425"Indicates that the server is unwilling to risk processing a request that might be replayed.
On this code, Inspector focuses on semantics, headers, and correctness warnings that commonly affect clients and caches.
HTTP 425 Too Early has specific technical implications for API design, caching, and client behavior. Understanding the precise semantics helps distinguish it from similar status codes and implement correct error handling. The response should include a descriptive body following a consistent error schema (like RFC 7807 Problem Details) so clients can programmatically handle the error.
// Handle 425 Too Early in Express
app.use((err, req, res, next) => {
if (err.status === 425) {
return res.status(425).json({
type: 'https://api.example.com/errors/too-early',
title: 'Too Early',
status: 425,
detail: err.message
});
}
next(err);
});from fastapi import HTTPException
# Raise 425 Too Early
raise HTTPException(
status_code=425,
detail={
'type': 'too_early',
'message': 'Descriptive error for 425 Too Early'
}
)// Spring Boot 425 Too Early handling
@ExceptionHandler(CustomTooEarlyException.class)
public ResponseEntity<ErrorResponse> handleTooEarly(
CustomTooEarlyException ex) {
return ResponseEntity.status(425)
.body(new ErrorResponse("Too Early", ex.getMessage()));
}// Return 425 Too Early
func errorHandler(w http.ResponseWriter, message string) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(425)
json.NewEncoder(w).Encode(map[string]any{
"status": 425,
"error": "Too Early",
"message": message,
})
}