505

HTTP Version Not Supported

5xx Server Error

Back to list

Server perspective

Use 505 when the request's HTTP major version is unsupported or intentionally refused by the server.

When to use

  • Return 505 when the client speaks a protocol version the server will not service
  • Use it for version incompatibility, not for unsupported methods or optional protocol upgrades

How to respond

  • If practical, describe which HTTP versions the server supports so clients can recover
  • Validate that the failure is really version-related and not just a malformed request line better described by 400

Headers to consider

  • No status-specific header is required; include explanatory metadata in the body when recovery is possible

Response body

  • A body is recommended; identify the unsupported version and the supported alternatives, if known

Server-side pitfalls

  • Do not use 505 when the server merely wants the client to switch protocols or upgrade features; compare with 426 Upgrade Required
  • Do not collapse general parsing bugs into 505 if the issue is ordinary malformed syntax

Examples

Legacy client sends HTTP/0.9 request

Request:GET /health using HTTP/0.9 syntax
Response:505 HTTP Version Not Supported with supported_versions: ["HTTP/1.1", "HTTP/2"]

The server rejects the old protocol version and tells the client what it can speak instead.

References

Related 5xx Server Error Codes