MethodHTTP request methods per RFC 9110 Section 9
HTTP methods indicate the desired action to be performed on a resource. The method token is case-sensitive.
Methods are considered "safe" if their semantics are read-only (GET, HEAD, OPTIONS, TRACE). Per RFC 9110 Section 9.2.1.
A method is "idempotent" if multiple identical requests have the same effect as a single request (GET, HEAD, PUT, DELETE, OPTIONS, TRACE). Per RFC 9110 Section 9.2.2.
val src : Logs.Src.tLog source for method operations
type t = [ | `GETRetrieve a resource
*)| `POSTSubmit data to be processed
*)| `PUTReplace a resource
*)| `DELETEDelete a resource
*)| `HEADRetrieve headers only
*)| `OPTIONSRetrieve allowed methods
*)| `PATCHPartial resource modification
*)| `CONNECTEstablish tunnel to server
*)| `TRACEEcho received request
*)| `Other of stringNon-standard or extension method
*) ]HTTP method type using polymorphic variants for better composability
val to_string : t -> stringConvert method to uppercase string representation
val of_string : string -> tParse method from string (case-insensitive). Returns `Other s for unrecognized methods.
val pp : Format.formatter -> t -> unitPretty printer for methods
val is_safe : t -> boolReturns true for safe methods (GET, HEAD, OPTIONS, TRACE). Safe methods should not have side effects.
val is_idempotent : t -> boolReturns true for idempotent methods (GET, HEAD, PUT, DELETE, OPTIONS, TRACE). Idempotent methods can be called multiple times with the same result.
val request_body_semantics : t -> body_semanticsReturns the request body semantics for a method per RFC 9110.
Body_required: POST, PUT, PATCH - body is expectedBody_optional: DELETE, OPTIONS, GET - body allowed but has no defined semanticsBody_forbidden: HEAD, TRACE, CONNECT - body MUST NOT be sentval has_request_body : t -> boolReturns true for methods that typically have a request body (POST, PUT, PATCH).
val is_cacheable : t -> boolReturns true for methods whose responses are cacheable by default (GET, HEAD, POST). Note: POST is only cacheable with explicit cache headers.