Everything you never wanted to know crammed into 10 minutes.
GET /resource
Host: example.com
HTTP/1.1 200 OK
Content-Type: application/json
Date: Tue, 5 Dec 2017 06:25:29 GMT
{ "my": "resource" }
POST /resource
Host: example.com
Content-Type: application/json
{ "my": "resource" }
HTTP/1.1 201 Created
Date: Tue, 5 Dec 2017 06:25:29 GMT
Location: /resource/new-resource-id
{
"my": "new resource"
}
POST /resource
Host: example.com
Content-Type: application/json
{ "my": "resource" }
HTTP/1.1 202 Accepted
Date: Tue, 5 Dec 2017 06:25:29 GMT
Location: "/some/monitoring/uri"
{
"status": "PENDING",
"monitor": "/some/monitoring/uri"
}
PUT /resource/my-resource-id
Host: example.com
HTTP/1.1 204 No Content
Date: Tue, 5 Dec 2017 06:25:29 GMT
DELETE /resource/my-resource-id
Host: example.com
HTTP/1.1 205 Reset Content
Date: Tue, 5 Dec 2017 06:25:29 GMT
PUT /resource/my-resource-id
Host: example.com
{ "malicious": "body" }
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm=example.com
GET /resource/admin-only-resource
Authorization: Bearer [token-without-admin-rights]
Host: example.com
HTTP/1.1 403 Forbidden
GET /resource/my-resource-id
Authorization: Bearer [token-without-admin-rights]
Host: example.com
HTTP/1.1 404 Not Found
XMLHttpRequest
transparently follows
redirects.
fetch()
permits interception.
GET /resource/my-resource-id
Host: example.com
HTTP/1.1 301 Moved Permanently
Location: https://example.com/resource/my-resource-id
PUT /resource/my-resource-id
Host: example.com
HTTP/1.1 302 Found
Location: /resource/some-other-location
GET /resource/some-other-location
Host: example.com
PUT /resource/my-resource-id
Host: example.com
HTTP/1.1 303 See Other
Location: /resource/some-other-location
GET /resource/some-other-location
Host: example.com
PUT /resource/my-resource-id
Host: example.com
HTTP/1.1 307 Temporary Redirect
Location: /resource/some-other-location
PUT /resource/my-resource-id
PUT /resource/my-resource-id
Host: example.com
HTTP/1.1 308 Permanent Redirect
Location: /resource/some-other-location
PUT /resource/some-other-location
PUT /resource/my-resource-id
Host: example.com
{ "malformed": "body" }
HTTP/1.1 400 Bad Request
POST /resource/my-resource-id
Host: example.com
{ "my": "resource" }
HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD, OPTIONS, PUT, DELETE
GET /resource/my-resource-id
Host: example.com
HTTP/1.1 500 Internal Server Error
CUSTOM_METHOD /resource/my-resource-id
Host: example.com
HTTP/1.1 501 Not Implemented
GET /resource/my-resource-id
Host: example.com
HTTP/1.1 503 Service Unavailable
Retry-After: 1000
PUT /resource/my-resource-id
Host: example.com
{ "my": "resource" }
HTTP/1.1 409 Conflict
Last-Modified: Thu, 8 Feb 2018 05:22:11 GMT
GET /resource/my-resource-id
Host: example.com
HTTP/1.1 410 Gone
Last-Modified: [date]
If-Modified-Since: [date]
If-Unmodified-Since: [date]
Etag: [etag]
If-Match: [etag]
If-None-Match: [etag]
GET /resource/my-resource-id
If-Modified-Since: Thu, 8 Feb 2018 05:22:11 GMT
HTTP/1.1 304 Not Modified
PUT /resource/my-resource-id
Host: example.com
HTTP/1.1 428 Precondition Required
{ 'If-Unmodified-Since': true }
PUT /resource/my-resource-id
Host: example.com
If-Unmodified-Since: Thu, 8 Feb 2018 05:22:11 GMT
{ "my": "resource" }
HTTP/1.1 412 Precondition Failed
GET /resource/all-tweets-in-the-world
Host: twitter.com
HTTP/1.1 420 Enhance Your Calm
GET /every/tweet/ever
Host: twitter.com
HTTP/1.1 429 Too Many Requests
Retry-After: 1000
GET /resource/my-resource-id
Host: example.com
HTTP/1.1 203 Non-Authoritative Information
X-Injected-Header: Proxy-id
Date: Tue, 5 Dec 2017 06:25:29 GMT
(Effectively a 200)
GET /resource/my-resource-id
Host: example.com
HTTP/1.1 305 Use Proxy
Location: https://different-aws-region.example.com/resource/my-resource-id
GET /resource/my-resource-id
Host: different-aws-region.example.com
HTTP/1.1 407 Proxy Authentication Required
Proxy-Authentication: Basic realm=corporate-proxy.example.com
GET /resource/my-resource-id
Host: different-aws-region.example.com
Proxy-Authorization: Basic [basic-auth-credentials]
GET /resource/my-resource-id
Host: example.com
HTTP/1.1 502 Bad Gateway
GET /resource/my-resource-id
Host: example.com
HTTP/1.1 504 Gateway Timeout
GET /coffee
Host: kitchen-util-1122313.local
HTTP/1.1 418 I'm a teapot
GET /start-the-uprising.pdf
Host: revolution.cn
HTTP/1.1 451 Unavailable for Legal Reasons