API Docs for:
Show:

http Class

Module: API

Methods for making HTTP requests.

Item Index

Methods

Methods

get

(
  • url
  • config
)
Object

Gets data from the given URL.

Parameters:

  • url String

    URL to post.

  • config Object

    Configuration for the request.

    • params Object

      Query arguments.

    • timeout Number

      Timeout in milliseconds.

    • headers Object

      HTTP headers.

    • contentType Object

      MIME type.

Returns:

Object: Returns an object with the following properties: body - contains body of response, status - itself an object containing properties code and description.

post

(
  • url
  • data
  • config
)
Object

Posts the given data to the given URL.

Parameters:

  • url String

    URL to post.

  • data Object

    Data to be posted.

  • config Object

    Configuration for the request.

    • params Object

      Query arguments.

    • timeout Number

      Timeout in milliseconds.

    • headers Object

      HTTP headers.

    • contentType Object

      MIME type.

Returns:

Object: Returns an object with the following properties: body - contains body of response, status - itself an object containing properties code and description.

post

(
  • url
  • object
  • config
)
Object

Makes a JSON-based POST request to the given URL.

Parameters:

  • url String

    URL to request from.

  • object Object

    Object to send.

  • config Object

    Configuration for the request.

    • params Object

      Query arguments.

    • timeout Number

      Timeout in milliseconds.

    • headers Object

      HTTP headers.

    • contentType Object

      MIME type.

Returns:

Object: Returns an object with the following properties: body - contains body of response, status - itself an object containing properties code and description.