Interface Config

Global configuration of this bundle.

interface Config {
    addProxyRule(rule): void;
    addTrustedServer(server): void;
    defaultProxy: undefined | string;
    disableProxySupport: boolean;
    interceptors: {}[];
    maxUrlLength: number;
    proxyRules: {
        origin: string;
        proxyUrl?: string;
    }[];
    registerInterceptor(interceptor): Handle;
    removeProxyRule(rule): void;
    removeTrustedServer(server): void;
    timeoutMillis: number;
    trustedServers: {
        origin: string;
    }[];
}

Properties

defaultProxy: undefined | string

The default proxy to use.

disableProxySupport: boolean

If this is true, proxy support will be completely disabled.

interceptors: {}[]

Globally registered interceptors.

Type declaration

    maxUrlLength: number

    Maximum length of an url before a GET request is switched to POST. GET requests altered in this way will have their query parameters placed into the new POST request's body (as content-type application/x-www-form-urlencoded).

    Switching to POST requests can be disabled by setting this property to a value <= 0.

    proxyRules: {
        origin: string;
        proxyUrl?: string;
    }[]

    Usage rules for proxied requests.

    When a proxy rule matches a request URL, the proxy will be chosen to perform the request instead.

    Type declaration

    • Readonly origin: string

      An origin to match against request URLs. URLs matching this origin pattern will use the configured proxyUrl (if present) or the default proxy URL.

      Origins must contain protocol, a hostname and (optionally) a port. For example, https://subdomain.arcgis.com is a valid origin.

    • Optional Readonly proxyUrl?: string

      URL to a server endpoint that can act as proxy. If this URL is not specified, a default proxy will be used.

    timeoutMillis: number

    Default time in milliseconds after which fetch aborts with a timeout.

    trustedServers: {
        origin: string;
    }[]

    Usages rules for trusted servers.

    apprt-fetch will automatically send credentials to these servers.

    Type declaration

    • Readonly origin: string

      An origin to match against request URLs.

      Origins must contain protocol, a hostname and (optionally) a port. For example, https://subdomain.arcgis.com is a valid origin.

    Methods

    • Adds a new proxy rule to the configuration. Requests that match the rule's origin will use the specified proxyUrl.

      Note: there can only be one proxy rule for an origin.

      Parameters

      Returns void

    • Adds a new trusted server rule to the configuration. Requests that match the rule will send credentials automatically, without the need to declare it in individual requests.

      Note: there can only be one trusted server rule for an origin.

      Parameters

      Returns void

    • Registers a global interceptor. Use the handle returned by this method to deregister the interceptor when it is no longer needed.

      Parameters

      Returns Handle

    • Removes a proxy rule from the configuration.

      Parameters

      Returns void

    • Removes a trusted server rule from the configuration.

      Parameters

      Returns void

    Generated using TypeDoc