Option for an external HTTP request

interface Options<T> {
    customHeaders?: {
        [key: string]: string;
    };
    data?: object;
    error?: CdvPurchase.Utils.Ajax.ErrorCallback;
    method?: string;
    success?: SuccessCallback<T>;
    timeout?: number;
    url: string;
}

Type Parameters

  • T

Properties

customHeaders?: {
    [key: string]: string;
}

Custom headers to pass tot the HTTP request.

Type declaration

  • [key: string]: string
data?: object

Payload for a POST request

Error callback taking the response error code, text and body as arguments

method?: string

Method for the request (POST, GET, ...)

success?: SuccessCallback<T>

A success callback taking the body as an argument

timeout?: number

Request timeout in milliseconds

url: string

URL of the request (https://example.com)