HTTP 404 Not Found indicates the server cannot find the requested resource. This is the most recognized HTTP status code, familiar even to non-technical users. While it simply means 'nothing here,' it carries significant SEO weight — Google treats persistent 404s as signals to remove URLs from its index. The response should include a helpful error page guiding users to find what they're looking for.
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/404
Example request:
curl -i "https://httpstatus.com/api/status/404"The requested resource could not be found but may be available in the future.
On this code, Inspector focuses on semantics, headers, and correctness warnings that commonly affect clients and caches.
HTTP 404 Not Found 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 404 Not Found in Express
app.use((err, req, res, next) => {
if (err.status === 404) {
return res.status(404).json({
type: 'https://api.example.com/errors/not-found',
title: 'Not Found',
status: 404,
detail: err.message
});
}
next(err);
});from fastapi import HTTPException
# Raise 404 Not Found
raise HTTPException(
status_code=404,
detail={
'type': 'not_found',
'message': 'Descriptive error for 404 Not Found'
}
)// Spring Boot 404 Not Found handling
@ExceptionHandler(CustomNotFoundException.class)
public ResponseEntity<ErrorResponse> handleNotFound(
CustomNotFoundException ex) {
return ResponseEntity.status(404)
.body(new ErrorResponse("Not Found", ex.getMessage()));
}// Return 404 Not Found
func errorHandler(w http.ResponseWriter, message string) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(404)
json.NewEncoder(w).Encode(map[string]any{
"status": 404,
"error": "Not Found",
"message": message,
})
}