HttpServerRequest.ts overview
Since v1.0.0
Exports Grouped by Category
accessors
persistedMultipart
Signature
declare const persistedMultipart: Effect.Effect<unknown, Multipart.MultipartError, any>
Since v1.0.0
upgrade
Signature
declare const upgrade: Effect.Effect<Socket.Socket, Error.RequestError, HttpServerRequest>
Since v1.0.0
upgradeChannel
Signature
declare const upgradeChannel: <IE = never>() => Channel<
Chunk<Uint8Array>,
Chunk<Uint8Array | string | Socket.CloseEvent>,
Error.RequestError | IE | Socket.SocketError,
IE,
void,
unknown,
HttpServerRequest
>
Since v1.0.0
context
HttpServerRequest
Signature
declare const HttpServerRequest: Context.Tag<HttpServerRequest, HttpServerRequest>
Since v1.0.0
conversions
fromWeb
Signature
declare const fromWeb: (request: Request) => HttpServerRequest
Since v1.0.0
toURL
Signature
declare const toURL: (self: HttpServerRequest) => Option<URL>
Since v1.0.0
fiber refs
maxBodySize
Signature
declare const maxBodySize: FiberRef.FiberRef<Option.Option<Brand.Branded<bigint, "Size">>>
Since 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
}
Since v1.0.0
schema
schemaBodyForm
Signature
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
>
Since v1.0.0
schemaBodyFormJson
Signature
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
>
Since v1.0.0
schemaBodyJson
Signature
declare const schemaBodyJson: <A, I, R>(
schema: Schema.Schema<A, I, R>,
options?: ParseOptions | undefined
) => Effect.Effect<A, Error.RequestError | ParseResult.ParseError, HttpServerRequest | R>
Since v1.0.0
schemaBodyMultipart
Signature
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
>
Since v1.0.0
schemaBodyUrlParams
Signature
declare const schemaBodyUrlParams: <
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 | Error.RequestError, R | HttpServerRequest>
Since v1.0.0
schemaCookies
Signature
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>
Since v1.0.0
schemaHeaders
Signature
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>
Since v1.0.0
schemaSearchParams
Signature
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>
Since v1.0.0
search params
ParsedSearchParams
Signature
declare const ParsedSearchParams: Context.Tag<ParsedSearchParams, ReadonlyRecord<string, string | Array<string>>>
Since v1.0.0
ParsedSearchParams (interface)
Signature
export interface ParsedSearchParams {
readonly _: unique symbol
}
Since v1.0.0
searchParamsFromURL
Signature
declare const searchParamsFromURL: (url: URL) => ReadonlyRecord<string, string | Array<string>>
Since v1.0.0
type ids
TypeId
Signature
declare const TypeId: unique symbol
Since v1.0.0
TypeId (type alias)
Signature
type TypeId = typeof TypeId
Since v1.0.0