syndicate_utils/http_protocol.prs

23 lines
703 B
Plaintext

version 1 .
Method = =GET / =HEAD / =POST / =PUT / =DELETE / =CONNECT / =OPTIONS / =TRACE / =PATCH .
Methods = #{Method} .
; A URL path split into elements
Path = [string ...] .
Listener = <listen @port int> .
; 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> .