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(self: Method) bool
Parameters
self: Method
Source
pub fn safe(self: Method) bool {
return switch (self) {
.GET, .HEAD, .OPTIONS, .TRACE => true,
.POST, .PUT, .DELETE, .CONNECT, .PATCH => false,
else => false,
};
}