Interface ConfigurableRequestFunction

The main interface of 'apprt-request'.

interface ConfigurableRequestFunction {
    config: Config;
    del: RequestFunction;
    get: RequestFunction;
    getProxiedUrl: ((url: string, options?: {
        force?: boolean;
    }) => string);
    post: RequestFunction;
    put: RequestFunction;
    (url: string, options?: RequestOptions): Promise<any>;
}

Hierarchy (view full)

  • Parameters

    Returns Promise<any>

Properties

config: Config

Provides access to configuration.

Executes a DELETE request (sets method=DELETE in the options)

Executes a GET request (sets method=GET in the options)

getProxiedUrl: ((url: string, options?: {
    force?: boolean;
}) => string)

Utility to create a 'proxied' url. By default it returns the input url, if no proxy rule applies. If the flag 'force' is enabled it will wrap the url with the default proxy.

Executes a POST request (sets method=POST in the options)

Executes a PUT request (sets method=PUT in the options)