RequestModule
PackageAxial.Hosting.GenHttp
Request decoders that contribute trusted values to an endpoint Flow.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| Operations | ||
| json | Request.json schema | Reads and schema-parses a JSON request body; malformed JSON and schema diagnostics become invalid-request failures. |
| query | Request.query schema | Schema-parses the query string. |
| raw | Request.raw projection | Projects untrusted input directly from the native request without schema parsing. |
| native | Request.native | Returns the native GenHTTP request for host-specific boundary handling. |
Operations
kind:member
Reads and schema-parses a JSON request body; malformed JSON and schema diagnostics become invalid-request failures.
Parameters
| Name | Type | Description |
|---|---|---|
| schema | Schema<'model> | The schema that establishes the trusted input type. |
Returns
Flow<HttpEndpointEnv<'app>, EndpointError<'error>, 'model>
Verification Examples
let! signup = Request.json Signup.schemakind:member
kind:member
Projects untrusted input directly from the native request without schema parsing.
Parameters
| Name | Type | Description |
|---|---|---|
| projection | IRequest -> 'input | The 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"])
