Skip to main content Link Search Menu Expand Document (external link)

HttpMethod.ts overview

Since v1.0.0


Exports Grouped by Category


models

HttpMethod (type alias)

Signature

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

Source

Since v1.0.0

HttpMethod (namespace)

Source

Since v1.0.0

NoBody (type alias)

Signature

type NoBody = "GET" | "HEAD" | "OPTIONS"

Source

Since v1.0.0

WithBody (type alias)

Signature

type WithBody = Exclude<HttpMethod, NoBody>

Source

Since v1.0.0

refinements

isHttpMethod

Tests if a value is a 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

Signature

declare const isHttpMethod: (u: unknown) => u is HttpMethod

Source

Since v1.0.0

utils

all

Signature

declare const all: ReadonlySet<HttpMethod>

Source

Since v1.0.0

hasBody

Signature

declare const hasBody: (method: HttpMethod) => boolean

Source

Since v1.0.0