HTTPQUERY

Learn, test, and verify HTTP — methods (including the new QUERY), status codes, and live requests

中文

HTTP Status Codes

Browse status codes by category. Expand any row to see a real HTTP message example for that code.

1xxInformational

100ContinueThe client should continue sending the request body.Example
                POST /uploads HTTP/1.1
Host: example.com
Content-Length: 5242880
Expect: 100-continue

HTTP/1.1 100 Continue

(client now streams the 5 MB body)

HTTP/1.1 201 Created
Location: /uploads/8f2c
              
101Switching ProtocolsThe server agrees to switch protocols (e.g. upgrade to WebSocket).Example
                GET /chat HTTP/1.1
Host: example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Version: 13

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
              

2xxSuccess

200OKThe request succeeded; the response contains the requested resource.Example
                GET /products/42 HTTP/1.1
Host: example.com

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 51

{ "id": 42, "name": "Trailhead Boot", "price": 189 }
              
201CreatedThe request succeeded and a new resource was created.Example
                POST /products HTTP/1.1
Host: example.com
Content-Type: application/json

{ "name": "Ridge Boot", "price": 210 }

HTTP/1.1 201 Created
Location: /products/43
Content-Type: application/json

{ "id": 43, "name": "Ridge Boot", "price": 210 }
              
204No ContentSucceeded, with no response body.Example
                DELETE /products/43 HTTP/1.1
Host: example.com

HTTP/1.1 204 No Content

(no body)
              

3xxRedirection

301Moved PermanentlyThe resource has permanently moved to the address in Location.Example
                GET /old-path HTTP/1.1
Host: example.com

HTTP/1.1 301 Moved Permanently
Location: https://example.com/new-path
              
302FoundThe resource is temporarily at Location.Example
                GET /account HTTP/1.1
Host: example.com

HTTP/1.1 302 Found
Location: /login
              
304Not ModifiedThe cache is valid; the local copy can be used directly.Example
                GET /logo.png HTTP/1.1
Host: example.com
If-None-Match: "9c2e-abc123"

HTTP/1.1 304 Not Modified
ETag: "9c2e-abc123"

(no body — reuse the cached copy)
              

4xxClient Error

400Bad RequestThe request syntax or parameters are invalid.Example
                POST /products HTTP/1.1
Host: example.com
Content-Type: application/json

{ "price": "not-a-number" }

HTTP/1.1 400 Bad Request
Content-Type: application/json

{ "error": "price must be a number" }
              
401UnauthorizedAuthentication is required.Example
                GET /account HTTP/1.1
Host: example.com

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="api"
              
403ForbiddenAuthenticated but not authorized.Example
                DELETE /users/1 HTTP/1.1
Host: example.com
Authorization: Bearer <valid-token>

HTTP/1.1 403 Forbidden
Content-Type: application/json

{ "error": "admin role required" }
              
404Not FoundThe target resource was not found.Example
                GET /products/9999 HTTP/1.1
Host: example.com

HTTP/1.1 404 Not Found
Content-Type: application/json

{ "error": "product 9999 not found" }
              
405Method Not AllowedThe method is not allowed for this resource.Example
                DELETE /products HTTP/1.1
Host: example.com

HTTP/1.1 405 Method Not Allowed
Allow: GET, POST, QUERY
              
418I'm a teapotI'm a teapot — the RFC 2324 easter-egg status code.Example
                BREW /coffee HTTP/1.1
Host: teapot.example

HTTP/1.1 418 I'm a teapot
Content-Type: text/plain

I refuse to brew coffee — I am a teapot.
              
429Too Many RequestsToo many requests; rate limited.Example
                GET /api/search HTTP/1.1
Host: example.com

HTTP/1.1 429 Too Many Requests
Retry-After: 30
Content-Type: application/json

{ "error": "rate limit exceeded" }
              

5xxServer Error

500Internal Server ErrorAn internal server error occurred.Example
                GET /report HTTP/1.1
Host: example.com

HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{ "error": "unexpected server error" }
              
502Bad GatewayThe gateway received an invalid response from upstream.Example
                GET /api/users HTTP/1.1
Host: gateway.example.com

HTTP/1.1 502 Bad Gateway
Content-Type: text/plain

upstream sent an invalid response
              
503Service UnavailableThe service is temporarily unavailable (overloaded or under maintenance).Example
                GET / HTTP/1.1
Host: example.com

HTTP/1.1 503 Service Unavailable
Retry-After: 120
Content-Type: text/plain

under maintenance — try again shortly