Hierarchy

  • INativeMobileComponent<any, MobileOSProps<HttpIOSProps, {}>>
    • IHttp

Properties

nativeObject: any
ios: Partial<HttpIOSProps>
android: Partial<{}>
cookiePersistenceEnabled: boolean

Toggles if the instance should keep the cookies from the server.

timeout: number

Get/sets the default timeout value. It is recommended to set this on constructor.

Default

10000

Example

import Http from '@smartface/native/net/http';
const http = new Http({
timeout: 5000,
//...other values
});
headers: Record<string, string>

Methods

  • Cancels all requests.

    Method

    cancelAll

    Android

    Ios

    Returns void

  • Method

    requestFile

    Sends an http request to given url and saves response file to temp directory of application. If request ends successfully onLoad callback will be called with received File object.

    Since

    0.1

    Parameters

    • params: FileRequestParams

    Returns HttpRequest

  • Method

    requestImage

    Sends an http request to given url. If request ends successfully onLoad callback will be called with received UI.Image object.

    Since

    0.1

    Parameters

    • params: ImageRequestParams

    Returns HttpRequest

  • Method

    requestString

    Sends an http request to given url. If request ends successfully onLoad callback will be called with received string.

    Since

    0.1

    Parameters

    • params: StringRequestParams

    Returns HttpRequest

  • Method

    requestJSON

    Sends an http request to given url. If request ends successfully onLoad callback will be called with received JSON object.

    Since

    0.1

    Parameters

    • params: JSONRequestParams

    Returns HttpRequest

  • Method

    request

    Sends an http request defined with parameters.

    Since

    0.1

    Parameters

    • params: RequestParams
    • Optional isMultipart: boolean

    Returns HttpRequest

  • Uploads something. Accepts blob as type.

    Parameters

    • params: UploadParams

    Returns HttpRequest

Generated using TypeDoc