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

HttpMethod overview

Added in v1.0.0


Table of contents


models

HttpMethod (type alias)

Signature

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

Added in v1.0.0

HttpMethod (namespace)

Added in v1.0.0

NoBody (type alias)

Signature

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

Added in v1.0.0

WithBody (type alias)

Signature

export type WithBody = Exclude<HttpMethod, NoBody>

Added in v1.0.0

refinements

isHttpMethod

Tests if a value is a HttpMethod.

Signature

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

Example

import { HttpMethod } from "@effect/platform"

assert.deepStrictEqual(HttpMethod.isHttpMethod("GET"), true)
assert.deepStrictEqual(HttpMethod.isHttpMethod("get"), false)
assert.deepStrictEqual(HttpMethod.isHttpMethod(1), false)

Added in v1.0.0

utils

all

Signature

export declare const all: ReadonlySet<HttpMethod>

Added in v1.0.0

hasBody

Signature

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

Added in v1.0.0