Function idempotent [src]
An HTTP method is idempotent if an identical request can be made once or several times in a row with the same effect while leaving the server in the same state.
https://developer.mozilla.org/en-US/docs/Glossary/Idempotent
https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.2
Prototype
pub fn idempotent(self: Method) bool
Parameters
self: Method
Source
pub fn idempotent(self: Method) bool {
return switch (self) {
.GET, .HEAD, .PUT, .DELETE, .OPTIONS, .TRACE => true,
.CONNECT, .POST, .PATCH => false,
else => false,
};
}