- Service available?
- callback:
service_available?
- false:
503 Service Unavailable
- callback:
- Known method?
- callback:
known_methods
- absent:
501 Not Implemented
- callback:
- URI too long?
- callback:
uri_too_long?
- true:
414 Request URI Too Long
- callback:
- Method allowed?
- callback:
allowed_methods
- absent:
405 Method Not Allowed
- callback:
- Malformed request?
- callbacks:
validate_content_checksum
,malformed_request?
- true:
400 Bad Request
- callbacks:
- Authorized?
- callback:
is_authorized?
- false:
401 Unauthorized
- callback:
- Forbidden?
- callback:
forbidden?
- true:
403 Forbidden
- callback:
- Valid
Content-*
headers?- callback:
valid_content_headers?
- false:
501 Not Implemented
- callback:
- Known content type?
- callback:
known_content_type?
- false:
415 Unsupported Media Type
- callback:
- Request entity too large?
- callback:
valid_entity_length?
- false:
413 Request Entity Too Large
- callback:
OPTIONS
?- callback:
options
- true:
200 OK
- callback:
Accept
exists?- true: Acceptable media type available?
- callback:
content_types_provided
- absent:
406 Not Acceptable
- callback:
- true: Acceptable media type available?
Accept-Language
exists?- true: Acceptable language available?
- callback:
languages_provided
- absent:
406 Not Acceptable
- callback:
- true: Acceptable language available?
Accept-Charset
exists?- true: Acceptable character set available?
- callback:
charsets_provided
- absent:
406 Not Acceptable
- callback:
- true: Acceptable character set available?
Accept-Encoding
exists?- true: Acceptable encoding available?
- callback:
encodings_available
- absent:
406 Not Acceptable
- callback:
- true: Acceptable encoding available?
- Set
Content-Type
header - Set
Vary
Header
- Resource exists?
- callback:
resource_exists?
- callback:
If-Match
exists?- true:
If-Match: *
exists?- false: ETag in
If-Match
?- callback:
generate_etag
- false:
412 Precondition Failed
- callback:
- false: ETag in
- true:
If-Unmodified-Since
exists?- true:
If-Unmodified-Since
is valid date?- true:
Last-Modified > If-Modified-Since
?- callback:
last_modified
- true:
412 Precondition Failed
- callback:
- true:
- true:
If-None-Match
exists?- true:
If-None-Match: *
exists?- false: ETag in
If-None-Match
?- callback:
generate_etag
- true:
304 Not Modified
- false:
412 Precondition Failed
- callback:
- true:
GET/HEAD
?- true:
304 Not Modified
(efficient cache updates) - false:
412 Precondition Failed
(avoidPUT
race conditions)
- true:
- false: ETag in
- true:
If-Modified-Since
exists?- true:
If-Modified-Since
is valid date?- true:
If-Modified-Since > now
?- false:
Last-Modified > If-Modified-Since
?- callback:
last_modified
- false:
304 Not Modified
- callback:
- false:
- true:
- true:
-
DELETE
?- true: Delete
- callback:
delete_resource
- false:
500 Internal Server Error
- true: Delete enacted?
- callbacks:
delete_completed?
- false:
202 Accepted
- true: Response includes an entity?
- false:
204 No Content
- true: Multiple Choices?
- callback:
multiple_choices?
- false:
200 OK
- true:
300 Multiple Choices
- callback:
- false:
- callbacks:
- callback:
- true: Delete
-
POST
?- true: Redirect?
- callback:
post_is_create?
- true: Create
- callbacks:
base_uri
,create_path
,content_types_accepted
->handler
- true:
303 See Other
- callbacks:
- false: Process
- callbacks:
process_post
- true: New Resource?
- true:
201 Created
- false: Response includes an entity?
- false:
204 No Content
- true: Multiple Choices?
- callback:
multiple_choices?
- false:
200 OK
- true:
300 Multiple Choices
- callback:
- false:
- true:
- callbacks:
- callback:
- true: Redirect?
-
PUT
?- true: Conflict?
- callback:
is_conflict?
- true:
409 Conflict
- false: New Resource?
- true:
201 Created
- false: Response includes an entity?
- false:
204 No Content
- true: Multiple Choices?
- callback:
multiple_choices?
- false:
200 OK
- true:
300 Multiple Choices
- callback:
- false:
- true:
- callback:
- true: Conflict?
-
(
GET
/HEAD
)- Generate body
- callback:
content_types_provided
->handler
- callback:
- Multiple Choices?
- callback:
multiple_choices?
- false:
200 OK
- true:
300 Multiple Choices
- callback:
- Generate body
If-Match: *
Exists?- true:
412 Precondition Failed
(PUT
race conditions) - false:
PUT
?
- true:
- Apply
PUT
to a different URL?- callback:
moved_permanently?
- true:
301 Moved Permanently
- false: Conflict?
- callback:
is_conflict?
- true:
409 Conflict
- false: New Resource?
- true:
201 Created
- false: Response includes an entity?
- false:
204 No Content
- true: Multiple Choices?
- callback:
multiple_choices?
- false:
200 OK
- true:
300 Multiple Choices
- false:
- callback:
- false:
- true:
- callback:
- callback:
- Resource previously existed?
- callback:
previously_existed?
- callback:
- Resource moved permanently?
- callback:
moved_permanently?
- true:
301 Moved Permanently
- callback:
- Resource moved temporarily?
- callback:
moved_temporarily?
- true:
307 Moved Temporarily
- callback:
POST
?- false:
404 Not Found
- true: Permit
POST
to missing resource?- callback:
allow_missing_post?
- false:
404 Not Found
- true: Redirect?
- callback:
post_is_create?
- true: Create
- callbacks:
base_uri
,create_path
,content_types_accepted
->handler
- true:
303 See Other
- callbacks:
- false: Process
- callbacks:
process_post
- true: New Resource?
- true:
201 Created
- false: Response includes an entity?
- false:
204 No Content
- true: Multiple Choices?
- callback:
multiple_choices?
- false:
200 OK
- true:
300 Multiple Choices
- callback:
- false:
- true:
- callbacks:
- callback:
- callback:
- false: