Request Payload Data Type
One of the basic functionality of typescript in this type of library, that is specifying the request type of payload. We define here the data that we want to send to the server.
Example
type RequestPayloadType = {
name: string;
email: string;
age: number;
};
const postUser = client.createRequest<ResponseType, RequestPayloadType>()({
method: "POST",
endpoint: "/users",
});