Nativescript plugin for https requests
    Preparing search index...

    Interface HttpsRequestOptions

    interface HttpsRequestOptions {
        allowLargeResponse?: boolean;
        body?: HttpsRequestObject | HttpsFormDataParam[] | File;
        cachePolicy?: CachePolicy;
        content?: any;
        cookiesEnabled?: boolean;
        downloadSizeThreshold?: number;
        earlyResolve?: boolean;
        headers?: Headers;
        method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
        onProgress?: (current: number, total: number) => void;
        params?: HttpsRequestObject;
        progressOnMainThread?: boolean;
        responseOnMainThread?: boolean;
        tag?: string;
        timeout?: number;
        url: string;
    }

    Hierarchy

    • HttpRequestOptions
      • HttpsRequestOptions
    Index

    Properties

    allowLargeResponse?: boolean

    On Android large responses may crash the app (fi. https://httpbin.org/bytes/10000). By setting this to true and when not using useLegacy, we allow large responses on the main thread (which this plugin currently does). Note that once set to true, this policy remains active until the app is killed.

    cachePolicy?: CachePolicy
    content?: any

    content can be used to pass native custom okhttp3.RequestBody

    cookiesEnabled?: boolean

    default to true. Android and iOS only store cookies in memory! it will be cleared after an app restart

    downloadSizeThreshold?: number

    iOS only: Response size threshold (in bytes) for using file download vs memory loading. Responses larger than this will be downloaded to temp file (memory efficient). Responses smaller will be loaded into memory (faster for small responses). Default: 1048576 (1 MB). Set to 0 to always use memory, -1 to always use file download.

    earlyResolve?: boolean

    iOS only: Resolve request promise as soon as headers are received, before download completes. This allows inspecting status/headers and cancelling before full download. When true, toFile()/toJSON()/etc. will wait for download completion. Default: false (waits for full download before resolving)

    headers?: Headers

    Gets or sets the request headers in JSON format.

    method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS"

    Gets or sets the request method.

    onProgress?: (current: number, total: number) => void

    iOS for now

    progressOnMainThread?: boolean
    responseOnMainThread?: boolean

    default to true. Put to false to run response callback on current thread

    tag?: string
    timeout?: number

    Default 10 (seconds).

    url: string

    Gets or sets the request url.