File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 55
66module Protocol
77 module HTTP
8- # All supported HTTP methods, as outlined by <https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods>.
8+ # Provides a convenient interface for commonly supported HTTP methods.
9+ #
10+ # | Method Name | Request Body | Response Body | Safe | Idempotent | Cacheable |
11+ # | ----------- | ------------ | ------------- | ---- | ---------- | --------- |
12+ # | GET | Optional | Yes | Yes | Yes | Yes |
13+ # | HEAD | Optional | No | Yes | Yes | Yes |
14+ # | POST | Yes | Yes | No | No | Yes |
15+ # | PUT | Yes | Yes | No | Yes | No |
16+ # | DELETE | Optional | Yes | No | Yes | No |
17+ # | CONNECT | Optional | Yes | No | No | No |
18+ # | OPTIONS | Optional | Yes | Yes | Yes | No |
19+ # | TRACE | No | Yes | Yes | Yes | No |
20+ # | PATCH | Yes | Yes | No | No | No |
21+ #
22+ # These methods are defined in this module using lower case names. They are for convenience only and you should not overload those methods.
23+ #
24+ # See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods> for more details.
925 class Methods
1026 # The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
1127 GET = 'GET'
Original file line number Diff line number Diff line change 1010
1111module Protocol
1212 module HTTP
13+ # The middleware interface provides a convenient wrapper for implementing HTTP middleware.
14+ #
15+ # A middleware instance generally needs to respond to two methods:
16+ #
17+ # - `call(request)` -> `response`
18+ # - `close()`
19+ #
20+ # The call method is called for each request. The close method is called when the server is shutting down.
21+ #
22+ # You do not need to use the Middleware class to implement middleware. You can implement the interface directly.
1323 class Middleware < Methods
1424 # Convert a block to a middleware delegate.
1525 def self . for ( &block )
You can’t perform that action at this time.
0 commit comments