/** Standard HTTP methods. */ export declare enum Method { /** RFC 9110, 9.3.1 */ Get = "GET", /** RFC 9110, 9.3.2 */ Head = "HEAD", /** RFC 9110, 9.3.3 */ Post = "POST", /** RFC 9110, 9.3.4 */ Put = "PUT", /** RFC 9110, 9.3.5 */ Delete = "DELETE", /** RFC 9110, 9.3.6 */ Connect = "CONNECT", /** RFC 9110, 9.3.7 */ Options = "OPTIONS", /** RFC 9110, 9.3.8 */ Trace = "TRACE", /** RFC 5789 */ Patch = "PATCH" } /** HTTP method that request retrieving data. */ export declare type RetrieveMethod = `${Method.Get}` | `${Method.Head}`; /** Whether the method is {@link RetrieveMethod} or not. * * @param method Any method * * @example * ```ts * import { isRetrieveMethod } from "https://deno.land/x/http_utils@$VERSION/method.ts"; * import { assert } from "https://deno.land/std@$VERSION/testing/asserts.ts"; * * assert(isRetrieveMethod("GET")); * assert(isRetrieveMethod("HEAD")); * assert(!isRetrieveMethod("POST")); * ``` */ export declare function isRetrieveMethod(method: string): method is RetrieveMethod; /** HTTP method that is read-only. * @see [RFC 9110, 9.2.1. Safe Methods](https://www.rfc-editor.org/rfc/rfc9110.html#name-safe-methods) */ export declare type SafeMethod = RetrieveMethod | `${Method.Options}` | `${Method.Trace}`; /** Whether the method is {@link SafeMethod} or not. * * @example * ```ts * import { isSafeMethod } from "https://deno.land/x/http_utils@$VERSION/method.ts"; * import { assert } from "https://deno.land/std@$VERSION/testing/asserts.ts"; * * assert(isSafeMethod("GET")); * assert(isSafeMethod("HEAD")); * assert(isSafeMethod("OPTIONS")); * assert(isSafeMethod("TRACE")); * ``` */ export declare function isSafeMethod(method: string): method is SafeMethod; /** HTTP method that is idempotent. * @see [RFC 9110, 9.2.2 Idempotent Methods](https://www.rfc-editor.org/rfc/rfc9110.html#name-idempotent-methods) */ export declare type IdempotentMethod = SafeMethod | `${Method.Put}` | `${Method.Delete}`; /** Whether the method is {@link IdempotentMethod} or not. * * @example * ```ts * import { isIdempotentMethod } from "https://deno.land/x/http_utils@$VERSION/method.ts"; * import { assert } from "https://deno.land/std@$VERSION/testing/asserts.ts"; * * assert(isIdempotentMethod("GET")); * assert(isIdempotentMethod("PUT")); * assert(isIdempotentMethod("DELETE")); * ``` */ export declare function isIdempotentMethod(method: string): method is IdempotentMethod;