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.
Type Parameters
Section titled “Type Parameters”Req
Res
Parameters
Section titled “Parameters”endpoint
Section titled “endpoint”ApiEndpoint<Req, Res>
Contract describing the endpoint method, path, and validators.
request
Section titled “request”Req
Caller input to validate and serialize.
options?
Section titled “options?”EndpointCallOptions = {}
Optional transport and request overrides for this call.
Returns
Section titled “Returns”Promise<EndpointValidationResult<Req, Res>>
A validation result tagged as either a request or response outcome.
Remarks
Section titled “Remarks”Request validation runs before transport execution. Invalid requests return a request-targeted validation result without performing a network call.
Example
Section titled “Example”const result = await callEndpoint(endpoint, { id: "post-1" }, { transport });