RequestModule

PackageAxial.Hosting.AspNetCore
Request decoders that contribute trusted values to an endpoint Flow.

Summary

NameSignatureSynopsis
Operations
jsonRequest.json schemaReads and schema-parses a JSON request body; malformed JSON and schema diagnostics become invalid-request failures.
formRequest.form schemaReads and schema-parses a posted form.
queryRequest.query schemaSchema-parses the query string.
routeRequest.route name schemaSchema-parses one named ASP.NET route value.
rawRequest.raw projectionProjects untrusted input directly from the native request without schema parsing.
nativeRequest.native Returns the native ASP.NET request for host-specific boundary handling.

Operations

kind:member

json

Request.json schema
Member
Reads and schema-parses a JSON request body; malformed JSON and schema diagnostics become invalid-request failures.

Parameters

NameTypeDescription
schemaSchema<'model>The schema that establishes the trusted input type.

Returns

Flow<HttpEndpointEnv<'app>, EndpointError<'error>, 'model>

Verification Examples

let! signup = Request.json Signup.schema
kind:member

form

Request.form schema
Member
Reads and schema-parses a posted form.

Parameters

NameTypeDescription
schemaSchema<'model>The schema that interprets the form name/value input.

Returns

Flow<HttpEndpointEnv<'app>, EndpointError<'error>, 'model>

Verification Examples

let! signup = Request.form Signup.schema
kind:member

query

Request.query schema
Member
Schema-parses the query string.

Parameters

NameTypeDescription
schemaSchema<'model>The schema that interprets the complete query input.

Returns

Flow<HttpEndpointEnv<'app>, EndpointError<'error>, 'model>

Verification Examples

let! search = Request.query Search.schema
kind:member

route

Request.route name schema
Member
Schema-parses one named ASP.NET route value.

Parameters

NameTypeDescription
namestringThe route-value name registered in the ASP.NET route pattern.
schemaSchema<'model>The schema that parses the scalar route text.

Returns

Flow<HttpEndpointEnv<'app>, EndpointError<'error>, 'model>

Verification Examples

let! userId = Request.route "id" UserId.schema
kind:member

raw

Request.raw projection
Member
Projects untrusted input directly from the native request without schema parsing.

Parameters

NameTypeDescription
projectionHttpRequest -> 'inputThe direct projection from the native request.

Returns

Flow<HttpEndpointEnv<'app>, EndpointError<'error>, 'input>

Verification Examples

let! signature = Request.raw (fun request -> string request.Headers["x-signature"])
kind:member

native

Request.native
Member
Returns the native ASP.NET request for host-specific boundary handling.

Returns

Flow<HttpEndpointEnv<'app>, EndpointError<'error>, HttpRequest>

Verification Examples

let! request = Request.native