This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
react-rest-request/target/endpoint.js

15 lines
467 B
JavaScript

export var Method;
(function (Method) {
Method["HEAD"] = "HEAD";
Method["GET"] = "GET";
Method["PUT"] = "PUT";
Method["POST"] = "POST";
Method["PATCH"] = "PATCH";
Method["DELETE"] = "DELETE";
})(Method || (Method = {}));
export function methodCanContainBody(method) {
return [Method.POST, Method.PATCH, Method.PUT].includes(method);
}
export function methodWithoutEffects(method) {
return [Method.HEAD, Method.GET].includes(method);
}