Effect CommunityEC
Effect Community7mo ago
3 replies
Régis

Accessing Typed JSON Payload in HttpApiEndpoint Post Request

Hello,
I have an HttpApiEndpoint.post defined with the payload.
In the handler, I access the request with
const req = yield* HttpServerRequest.HttpServerRequest;

The only way I found to access the body of the post request is with req.json. But it gives me a raw json without typing.
How can I access the parsed json value typed with the type defined in the setPayload ?
Was this page helpful?