HttpClientRequest overview
Added in v1.0.0
Table of contents
- combinators
- accept
- acceptJson
- appendUrl
- appendUrlParam
- appendUrlParams
- basicAuth
- bearerToken
- fileBody
- fileWebBody
- formDataBody
- jsonBody
- modify
- prependUrl
- removeHash
- schemaBody
- setBody
- setHash
- setHeader
- setHeaders
- setMethod
- setUrl
- setUrlParam
- setUrlParams
- streamBody
- textBody
- uint8ArrayBody
- unsafeJsonBody
- updateUrl
- urlParamsBody
- constructors
- models
- type ids
- utils
combinators
accept
Signature
export declare const accept: {
(mediaType: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, mediaType: string): HttpClientRequest
}
Added in v1.0.0
acceptJson
Signature
export declare const acceptJson: (self: HttpClientRequest) => HttpClientRequest
Added in v1.0.0
appendUrl
Signature
export declare const appendUrl: {
(path: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, path: string): HttpClientRequest
}
Added in v1.0.0
appendUrlParam
Signature
export declare const appendUrlParam: {
(key: string, value: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
}
Added in v1.0.0
appendUrlParams
Signature
export declare const appendUrlParams: {
(input: UrlParams.Input): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
}
Added in v1.0.0
basicAuth
Signature
export declare const basicAuth: {
(username: string, password: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, username: string, password: string): HttpClientRequest
}
Added in v1.0.0
bearerToken
Signature
export declare const bearerToken: {
(token: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, token: string): HttpClientRequest
}
Added in v1.0.0
fileBody
Signature
export declare const fileBody: {
(
path: string,
options?: FileSystem.StreamOptions & { readonly contentType?: string }
): (self: HttpClientRequest) => Effect.Effect<HttpClientRequest, PlatformError.PlatformError, FileSystem.FileSystem>
(
self: HttpClientRequest,
path: string,
options?: FileSystem.StreamOptions & { readonly contentType?: string }
): Effect.Effect<HttpClientRequest, PlatformError.PlatformError, FileSystem.FileSystem>
}
Added in v1.0.0
fileWebBody
Signature
export declare const fileWebBody: {
(file: Body.HttpBody.FileLike): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, file: Body.HttpBody.FileLike): HttpClientRequest
}
Added in v1.0.0
formDataBody
Signature
export declare const formDataBody: {
(body: FormData): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, body: FormData): HttpClientRequest
}
Added in v1.0.0
jsonBody
Signature
export declare const jsonBody: {
(body: unknown): (self: HttpClientRequest) => Effect.Effect<HttpClientRequest, Body.HttpBodyError>
(self: HttpClientRequest, body: unknown): Effect.Effect<HttpClientRequest, Body.HttpBodyError>
}
Added in v1.0.0
modify
Signature
export declare const modify: {
(options: Options): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, options: Options): HttpClientRequest
}
Added in v1.0.0
prependUrl
Signature
export declare const prependUrl: {
(path: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, path: string): HttpClientRequest
}
Added in v1.0.0
removeHash
Signature
export declare const removeHash: (self: HttpClientRequest) => HttpClientRequest
Added in v1.0.0
schemaBody
Signature
export declare const schemaBody: <A, I, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => {
(body: A): (self: HttpClientRequest) => Effect.Effect<HttpClientRequest, Body.HttpBodyError, R>
(self: HttpClientRequest, body: A): Effect.Effect<HttpClientRequest, Body.HttpBodyError, R>
}
Added in v1.0.0
setBody
Signature
export declare const setBody: {
(body: Body.HttpBody): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, body: Body.HttpBody): HttpClientRequest
}
Added in v1.0.0
setHash
Signature
export declare const setHash: {
(hash: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, hash: string): HttpClientRequest
}
Added in v1.0.0
setHeader
Signature
export declare const setHeader: {
(key: string, value: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
}
Added in v1.0.0
setHeaders
Signature
export declare const setHeaders: {
(input: Headers.Input): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, input: Headers.Input): HttpClientRequest
}
Added in v1.0.0
setMethod
Signature
export declare const setMethod: {
(method: HttpMethod): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, method: HttpMethod): HttpClientRequest
}
Added in v1.0.0
setUrl
Signature
export declare const setUrl: {
(url: string | URL): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, url: string | URL): HttpClientRequest
}
Added in v1.0.0
setUrlParam
Signature
export declare const setUrlParam: {
(key: string, value: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, key: string, value: string): HttpClientRequest
}
Added in v1.0.0
setUrlParams
Signature
export declare const setUrlParams: {
(input: UrlParams.Input): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
}
Added in v1.0.0
streamBody
Signature
export declare const streamBody: {
(
body: Stream.Stream<Uint8Array, unknown>,
options?: { readonly contentType?: string | undefined; readonly contentLength?: number | undefined } | undefined
): (self: HttpClientRequest) => HttpClientRequest
(
self: HttpClientRequest,
body: Stream.Stream<Uint8Array, unknown>,
options?: { readonly contentType?: string | undefined; readonly contentLength?: number | undefined } | undefined
): HttpClientRequest
}
Added in v1.0.0
textBody
Signature
export declare const textBody: {
(body: string, contentType?: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, body: string, contentType?: string): HttpClientRequest
}
Added in v1.0.0
uint8ArrayBody
Signature
export declare const uint8ArrayBody: {
(body: Uint8Array, contentType?: string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, body: Uint8Array, contentType?: string): HttpClientRequest
}
Added in v1.0.0
unsafeJsonBody
Signature
export declare const unsafeJsonBody: {
(body: unknown): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, body: unknown): HttpClientRequest
}
Added in v1.0.0
updateUrl
Signature
export declare const updateUrl: {
(f: (url: string) => string): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, f: (url: string) => string): HttpClientRequest
}
Added in v1.0.0
urlParamsBody
Signature
export declare const urlParamsBody: {
(input: UrlParams.Input): (self: HttpClientRequest) => HttpClientRequest
(self: HttpClientRequest, input: UrlParams.Input): HttpClientRequest
}
Added in v1.0.0
constructors
del
Signature
export declare const del: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest
Added in v1.0.0
get
Signature
export declare const get: (url: string | URL, options?: Options.NoBody) => HttpClientRequest
Added in v1.0.0
head
Signature
export declare const head: (url: string | URL, options?: Options.NoBody) => HttpClientRequest
Added in v1.0.0
make
Signature
export declare const make: <M extends HttpMethod>(
method: M
) => (
url: string | URL,
options?: (M extends "GET" | "HEAD" ? Options.NoBody : Options.NoUrl) | undefined
) => HttpClientRequest
Added in v1.0.0
options
Signature
export declare const options: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest
Added in v1.0.0
patch
Signature
export declare const patch: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest
Added in v1.0.0
post
Signature
export declare const post: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest
Added in v1.0.0
put
Signature
export declare const put: (url: string | URL, options?: Options.NoUrl) => HttpClientRequest
Added in v1.0.0
models
HttpClientRequest (interface)
Signature
export interface HttpClientRequest
extends Effect.Effect<HttpClientResponse, HttpClientError, HttpClient.Default | Scope>,
Inspectable {
readonly [TypeId]: TypeId
readonly method: HttpMethod
readonly url: string
readonly urlParams: UrlParams.UrlParams
readonly hash: Option.Option<string>
readonly headers: Headers.Headers
readonly body: Body.HttpBody
}
Added in v1.0.0
Options (interface)
Signature
export interface Options {
readonly method?: HttpMethod | undefined
readonly url?: string | URL | undefined
readonly urlParams?: UrlParams.Input | undefined
readonly hash?: string | undefined
readonly headers?: Headers.Input | undefined
readonly body?: Body.HttpBody | undefined
readonly accept?: string | undefined
readonly acceptJson?: boolean | undefined
}
Added in v1.0.0
type ids
TypeId
Signature
export declare const TypeId: typeof TypeId
Added in v1.0.0
TypeId (type alias)
Signature
export type TypeId = typeof TypeId
Added in v1.0.0
utils
Options (namespace)
Added in v1.0.0
NoBody (interface)
Signature
export interface NoBody extends Omit<Options, "method" | "url" | "body"> {}
Added in v1.0.0
NoUrl (interface)
Signature
export interface NoUrl extends Omit<Options, "method" | "url"> {}
Added in v1.0.0