Function safe [src]
An HTTP method is safe if it doesn't alter the state of the server.
https://developer.mozilla.org/en-US/docs/Glossary/Safe/HTTP
https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.1
Prototype
pub fn safe(m: Method) bool
Parameters
m: Method
Source
pub fn safe(m: Method) bool {
return switch (m) {
.GET, .HEAD, .OPTIONS, .TRACE => true,
.POST, .PUT, .DELETE, .CONNECT, .PATCH => false,
};
}