ResponseModule

PackageAxial.Hosting.GenHttp
Successful responses returned by GenHTTP endpoint Flows.

Summary

NameSignatureSynopsis
Operations
jsonResponse.json status codec valueSerializes a trusted value as JSON through a compiled codec.
emptyResponse.empty statusReturns an empty response with the supplied status.
textResponse.text status valueReturns a plain-text response.
nativeResponse.native respondBuilds a host-native response plan from the current GenHTTP request.

Operations

kind:member

json

Response.json status codec value
Member
Serializes a trusted value as JSON through a compiled codec.

Parameters

NameTypeDescription
statusResponseStatusThe successful HTTP status.
codecJsonCodec<'model>The compiled codec for the trusted output type.
value'modelThe trusted output value.

Returns

HttpResponse

Verification Examples

return Response.json ResponseStatus.Created Signup.codec signup
kind:member

empty

Response.empty status
Member
Returns an empty response with the supplied status.

Parameters

NameTypeDescription
statusResponseStatusThe successful HTTP status.

Returns

HttpResponse

Verification Examples

return Response.empty ResponseStatus.NoContent
kind:member

text

Response.text status value
Member
Returns a plain-text response.

Parameters

NameTypeDescription
statusResponseStatusThe successful HTTP status.
valuestringThe response text.

Returns

HttpResponse

Verification Examples

return Response.text ResponseStatus.Ok "ready"
kind:member

native

Response.native respond
Member
Builds a host-native response plan from the current GenHTTP request.

Parameters

NameTypeDescription
respondIRequest -> IResponseThe host-specific response function.

Returns

HttpResponse

Verification Examples

return Response.native (fun request -> request.Respond().Build())