Skip to content

callEndpoint

callEndpoint<Req, Res>(endpoint, request, options?): Promise<EndpointValidationResult<Req, Res>>

Defined in: wp-typia-api-client/src/client.ts:479

Execute an endpoint contract with validated input and validated output.

Req

Res

ApiEndpoint<Req, Res>

Contract describing the endpoint method, path, and validators.

Req

Caller input to validate and serialize.

EndpointCallOptions = {}

Optional transport and request overrides for this call.

Promise<EndpointValidationResult<Req, Res>>

A validation result tagged as either a request or response outcome.

Request validation runs before transport execution. Invalid requests return a request-targeted validation result without performing a network call.

const result = await callEndpoint(endpoint, { id: "post-1" }, { transport });