Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Request

Index

Constructors

  • Create a new HTTP Request.

    Parameters

    • url: string

      The URL to be requested.

    Returns Request

Methods

  • addCookieJar(cookieJar: string): Request
  • Add a cookie jar to the request.

    Parameters

    • cookieJar: string

    Returns Request

  • Add a single post data string to the request. Not compatible if using addMultipartData or addMultipartFile.

    Parameters

    • string: string

    Returns Request

  • addHeader(name: string, value: string): Request
  • Add a header to the request.

    Parameters

    • name: string
    • value: string

    Returns Request

  • addMultipartData(name: string, value: string): Request
  • Able to be used multiple times, each time to add a new post data string to the request. Will override use of addData().

    Parameters

    • name: string
    • value: string

    Returns Request

  • addMultipartFile(fieldName: string, fileName: string): Request
  • Able to be used multiple times, each time to add a new file to the request. Will override use of addData(). If you want to add data and a file you need to use addMultipartData().

    Parameters

    • fieldName: string
    • fileName: string

    Returns Request

  • addParameter(name: string, value: string): Request
  • Add a URL parameter.

    Parameters

    • name: string
    • value: string

    Returns Request

  • Perform an HTTP Delete request.

    Returns Request

  • Perform an HTTP Get request.

    Returns Request

  • onError(callback: (error: string, response: Response, ...optionalParams: any[]) => any, parameters?: any[]): Request
  • Set the callback function for a failed request.

    Parameters

    • callback: (error: string, response: Response, ...optionalParams: any[]) => any

      Reference to the function that will be called when the request fails.

        • (error: string, response: Response, ...optionalParams: any[]): any
        • Parameters

          • error: string
          • response: Response
          • Rest ...optionalParams: any[]

          Returns any

    • Optional parameters: any[]

      An Array of parameters that will be send to the callback when it is called.

    Returns Request

  • onSuccess(callback: (response: Response, body: any, ...optionalParams: any[]) => any, parameters?: any[]): Request
  • Set the callback function for a successful request.

    Parameters

    • callback: (response: Response, body: any, ...optionalParams: any[]) => any

      Reference to the function that will be called when the request is successful.

        • (response: Response, body: any, ...optionalParams: any[]): any
        • Parameters

          • response: Response
          • body: any
          • Rest ...optionalParams: any[]

          Returns any

    • Optional parameters: any[]

      An Array of parameters that will be send to the callback when it is called.

    Returns Request

  • Perform an HTTP Post request.

    Returns Request

  • Perform an HTTP Put request.

    Returns Request