Interface RequestOptions

Request options

interface RequestOptions {
    authenticationProvider?: AuthenticationProvider;
    cache?: string;
    cacheKey?: string;
    cancellationToken?: CancellationToken;
    credentials?: RequestCredentials;
    data?: any;
    error?: (reason: any) => void;
    headers?: Record<string, string>;
    method: string;
    parser?: (response: Response) => Promise<any>;
    retry?: (attempt: number) => void;
    retryAttempts?: number;
    retryDelay?: number;
    serializer?: (data: any) => string;
    storageMode?: StorageMode;
    success?: (response: any) => void;
    timeout?: number;
    url: string;
}

Properties

authenticationProvider?: AuthenticationProvider

Authentication provider (default: null)

cache?: string

Cache name (default: "Default")

cacheKey?: string

Cache key (default: url + JSON.stringify(data))

cancellationToken?: CancellationToken

Request cancellation token (default: null)

credentials?: RequestCredentials

Request credentials (default: same-origin)

data?: any

Request data

error?: (reason: any) => void

Request error callback (default: Logger.error)

headers?: Record<string, string>

Request headers (default: {})

method: string

Request method (default: GET)

parser?: (response: Response) => Promise<any>

Request parser (default: response.json())

retry?: (attempt: number) => void

Request retry callback (default: Logger.debug)

retryAttempts?: number

Retry attempts (default: 3)

retryDelay?: number

Retry delay in milliseconds (default: 1000)

serializer?: (data: any) => string

Request serializer (default: JSON.stringify)

storageMode?: StorageMode

Storage mode (default: StorageMode.NetworkFirst)

success?: (response: any) => void

Request success callback (default: Logger.debug)

timeout?: number

Timeout in milliseconds (default: 60000)

url: string

Request url (default: "")