Skip to content
Effect Days 2026 Get your ticket

HttpMethod

5 exports Added in v1.0.0 Source

Models

HttpMethod

Added in v1.0.0 Source

HttpMethod type

Added in v1.0.0 Source

Signature

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

Other

all

Added in v1.0.0 Source

Signature

declare const all: ReadonlySet<HttpMethod>

hasBody

Added in v1.0.0 Source

Signature

declare function hasBody(method: HttpMethod): boolean

Refinements

isHttpMethod

Added in v1.0.0 Source

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