@adyen/api-library
Version:
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
31 lines (30 loc) • 1.63 kB
TypeScript
/// <reference types="node" />
import { AgentOptions } from "https";
import Config from "../config";
import ClientInterface from "./clientInterface";
import { IRequest } from "../typings/requestOptions";
declare class HttpURLConnectionClient implements ClientInterface {
private static CHARSET;
proxy?: AgentOptions;
private agentOptions;
/**
* Sends an HTTP request to the specified endpoint with the provided JSON payload and configuration.
*
* This method sets up request headers, including authentication (API key or basic auth), content type,
* and timeout. If a certificate path is provided in the config, it installs a certificate verifier.
* Throws an ApiException when an error occurs (invalid API key, API error response, etc.).
*
* @param endpoint - The URL to which the request will be sent.
* @param json - The JSON string to be sent as the request body.
* @param config - The configuration object containing authentication, timeout, and certificate details.
* @param isApiRequired - Indicates whether an API key is required for this request.
* @param requestOptions - Additional options for the HTTP request, such as headers and timeout.
* @returns A promise that resolves with the response body as a string.
* @throws {ApiException} when an error occurs
*/
request(endpoint: string, json: string, config: Config, isApiRequired: boolean, requestOptions: IRequest.Options): Promise<string>;
private createRequest;
private doRequest;
private installCertificateVerifier;
}
export default HttpURLConnectionClient;