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"
Since v1.0.0
HttpMethod (namespace)
Since v1.0.0
NoBody (type alias)
Signature
type NoBody = "GET" | "HEAD" | "OPTIONS"
Since v1.0.0
WithBody (type alias)
Signature
type WithBody = Exclude<HttpMethod, NoBody>
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
Since v1.0.0
utils
all
Signature
declare const all: ReadonlySet<HttpMethod>
Since v1.0.0
hasBody
Signature
declare const hasBody: (method: HttpMethod) => boolean
Since v1.0.0