Net.HTTP.Method
A request method, carrying the request's body where the method has one.
match req.method {
GET -> ...
POST(body) -> ...
}
The body is the method's payload, so a GET with a body cannot be written,
and a server's match takes the body out of the pattern that picks the
method. An extension method may or may not have one.
The name of an extension method: a token, case kept, that is not one of
the nine above. Refusing those keeps one spelling for each method, so
Extension cannot write a GET that carries a body.
Returns the extension method s names. Method names are case-sensitive,
so get is an extension method and GET is not.
Returns the method's name as it is sent: GET, POST, ...
Whether the method is safe (RFC 9110 §9.2.1): it asks only to read, so sending it changes nothing on the server. An extension method is not known to be.
Whether sending the request twice has the effect of sending it once (RFC 9110 §9.2.2), which is what lets a client send it again after a connection fails part-way.
Shows the name alone, never the body.
map(m, f) replaces the body, if the method has one, by f of it, and
leaves the method as it is: a codec turns POST(bytes) into
POST(decoded) without a match that names every method.