Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

HttpMethod

5 exports Since v1.0.0 Source

Models

Since v1.0.0

Signature

type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS"

Other

Since v1.0.0

Signature

declare const all: ReadonlySet<HttpMethod>
Since v1.0.0

Signature

declare function hasBody(method: HttpMethod): boolean

Refinements

Tests if a value is a HttpMethod.

Signature

declare function isHttpMethod(u: unknown): u is HttpMethod

Example

import { HttpMethod } from "@effect/platform"
console.log(HttpMethod.isHttpMethod("GET"))
// true
console.log(HttpMethod.isHttpMethod("get"))
// false
console.log(HttpMethod.isHttpMethod(1))
// false