21 lines
670 B
Plaintext
21 lines
670 B
Plaintext
|
version 1 .
|
||
|
|
||
|
Method = =GET / =HEAD / =POST / =PUT / =DELETE / =CONNECT / =OPTIONS / =TRACE / =PATCH .
|
||
|
Methods = #{Method} .
|
||
|
|
||
|
; A URL path split into elements
|
||
|
Path = [string ...] .
|
||
|
|
||
|
; Register an entity that will handle requests at path prefix.
|
||
|
; TODO: assert the public base URL of the handler to the entity.
|
||
|
Handler = <handler @methods Methods @path Path @entity #!any> .
|
||
|
|
||
|
Headers = {string: [string ...] ...:...} .
|
||
|
|
||
|
; A request awaiting a response at handle.
|
||
|
; TODO: query parameters
|
||
|
Request = <http @handle int @method Method @headers Headers @path Path @body string> .
|
||
|
|
||
|
; A response to handle.
|
||
|
Response = <http @handle int @code int @headers Headers @body string> .
|