Normal Mode
Returns just the response data.
// Default — returns just the data
const users = await caller.users.getAll()
// → { data: [...], total: 3 }// run the request to see the responseRequests
as the browser recorded them and the site's server told of them
Raw Data Mode
Returns status, headers, and data. The headers are the API's, as the site's proxy route passed them on: its request below names those the API answered with and those the route answered the browser with, so you see which went through and which stayed behind — a connection's own, as keep-alive.
// .raw accessor — returns { status, headers, data }
const response = await caller.users.raw.getAll()
// response.status → 200
// response.headers → Headers { etag, vary, … }: those that describe the answer
// response.data → { data: [...], total: 3 }// run the request to see the responseRequests
as the browser recorded them and the site's server told of them
Type Safety
TypeScript follows the accessor: .raw types the call as an HttpResponse.
// The .raw accessor changes what the call is typed to return
const data = await caller.users.getAll()
// ^? { data: User[]; total: number }
const response = await caller.users.raw.getAll()
// ^? HttpResponse<{ data: User[]; total: number }>
// { status: number; headers: Headers; data: … }With the .raw accessor, the return type wraps data in an HttpResponse object with status and headers. Without it, you get the data directly.