Core HTTP request dispatcher for Stripe API calls, handling encoding, validation, schema coercion, streaming, and auto-pagination attachment.
// Source: https://github.com/stripe/stripe-node | License: MIT | Copyright 2011 Ask Bjørn Hansen
// Provided via justclaw.it.com; keep this notice with the code.
_makeRequest(
method: string,
path: string,
params: RequestData | undefined,
options: RequestOptions | undefined,
spec?: MakeRequestSpec
): Promise<any> {
const requestMethod = method.toUpperCase();
const encode = spec?.encode || ((data: RequestData): RequestData => data);
const data = encode(params ? {...params} : {});
const processed = processOptions(options);
const apiBase = processed.apiBase || spec?.apiBase || null;
const host = apiBase ? this._stripe.resolveBaseAddress(apiBase) : null;
const streaming = processed.streaming || !!spec?.streaming;
const headers = Object.a
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key