HttpServerRequest overview
Added in v1.0.0
Table of contents
accessors
persistedMultipart
Signature
export declare const persistedMultipart: Effect.Effect<unknown, Multipart.MultipartError, any>
Added in v1.0.0
upgrade
Signature
export declare const upgrade: Effect.Effect<Socket.Socket, Error.RequestError, HttpServerRequest>
Added in v1.0.0
upgradeChannel
Signature
export declare const upgradeChannel: <IE = never>() => Channel<
Chunk<Uint8Array>,
Chunk<Uint8Array | string | Socket.CloseEvent>,
Error.RequestError | IE | Socket.SocketError,
IE,
void,
unknown,
HttpServerRequest
>
Added in v1.0.0
context
HttpServerRequest
Signature
export declare const HttpServerRequest: Context.Tag<HttpServerRequest, HttpServerRequest>
Added in v1.0.0
conversions
fromWeb
Signature
export declare const fromWeb: (request: Request) => HttpServerRequest
Added in v1.0.0
toURL
Signature
export declare const toURL: (self: HttpServerRequest) => Option<URL>
Added in v1.0.0
fiber refs
maxBodySize
Signature
export declare const maxBodySize: FiberRef.FiberRef<Option.Option<Brand.Branded<bigint, "Size">>>
Added in v1.0.0
models
HttpServerRequest (interface)
Signature
export interface HttpServerRequest extends IncomingMessage.HttpIncomingMessage<Error.RequestError> {
readonly [TypeId]: TypeId
readonly source: unknown
readonly url: string
readonly originalUrl: string
readonly method: HttpMethod
readonly cookies: ReadonlyRecord<string, string>
readonly multipart: Effect.Effect<
Multipart.Persisted,
Multipart.MultipartError,
Scope.Scope | FileSystem.FileSystem | Path.Path
>
readonly multipartStream: Stream.Stream<Multipart.Part, Multipart.MultipartError>
readonly upgrade: Effect.Effect<Socket.Socket, Error.RequestError>
readonly modify: (options: {
readonly url?: string
readonly headers?: Headers.Headers
readonly remoteAddress?: string
}) => HttpServerRequest
}
Added in v1.0.0
schema
schemaBodyForm
Signature
export declare const schemaBodyForm: <A, I extends Partial<Multipart.Persisted>, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => Effect.Effect<
A,
Multipart.MultipartError | ParseResult.ParseError | Error.RequestError,
R | HttpServerRequest | Scope.Scope | FileSystem.FileSystem | Path.Path
>
Added in v1.0.0
schemaBodyFormJson
Signature
export declare const schemaBodyFormJson: <A, I, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => (
field: string
) => Effect.Effect<
A,
ParseResult.ParseError | Error.RequestError,
R | HttpServerRequest | FileSystem.FileSystem | Path.Path | Scope.Scope
>
Added in v1.0.0
schemaBodyJson
Signature
export declare const schemaBodyJson: <A, I, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => Effect.Effect<A, Error.RequestError | ParseResult.ParseError, HttpServerRequest | R>
Added in v1.0.0
schemaBodyMultipart
Signature
export declare const schemaBodyMultipart: <A, I extends Partial<Multipart.Persisted>, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => Effect.Effect<
A,
Multipart.MultipartError | ParseResult.ParseError,
R | HttpServerRequest | Scope.Scope | FileSystem.FileSystem | Path.Path
>
Added in v1.0.0
schemaBodyUrlParams
Signature
export declare const schemaBodyUrlParams: <A, I extends Readonly<Record<string, string | undefined>>, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => Effect.Effect<A, ParseResult.ParseError | Error.RequestError, R | HttpServerRequest>
Added in v1.0.0
schemaCookies
Signature
export declare const schemaCookies: <A, I extends Readonly<Record<string, string | undefined>>, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => Effect.Effect<A, ParseResult.ParseError, HttpServerRequest | R>
Added in v1.0.0
schemaHeaders
Signature
export declare const schemaHeaders: <A, I extends Readonly<Record<string, string | undefined>>, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => Effect.Effect<A, ParseResult.ParseError, HttpServerRequest | R>
Added in v1.0.0
schemaSearchParams
Signature
export declare const schemaSearchParams: <
A,
I extends Readonly<Record<string, string | ReadonlyArray<string> | undefined>>,
R
>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => Effect.Effect<A, ParseResult.ParseError, ParsedSearchParams | R>
Added in v1.0.0
search params
ParsedSearchParams
Signature
export declare const ParsedSearchParams: Context.Tag<ParsedSearchParams, ReadonlyRecord<string, string | string[]>>
Added in v1.0.0
ParsedSearchParams (interface)
Signature
export interface ParsedSearchParams {
readonly _: unique symbol
}
Added in v1.0.0
searchParamsFromURL
Signature
export declare const searchParamsFromURL: (url: URL) => ReadonlyRecord<string, string | Array<string>>
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