Module: httpUtil

Methods

(static) delete(url, optionsopt) → {String}

Deletes data from a URL.

Parameters:
Name Type Attributes Description
url String

URL from which to get the data.

options Object <optional>

Optional parameters

Properties
Name Type Attributes Description
headers Object <optional>

Map of headers to add to the request. Format:

              {
                  <header1_name>: <header1_value>,
                  <header2_name>: <header2_value>
              }
body Object <optional>

Body to send with request

Returns:

A promise which will be resolved with the data or rejected if an error occurs.

Type
String

(static) get(url, optionsopt) → {String}

Gets data from a URL.

Parameters:
Name Type Attributes Description
url String

URL from which to get the data.

options Object <optional>

Optional parameters

Properties
Name Type Attributes Description
headers Object <optional>

Map of headers to add to the request. Format:

              {
                  <header1_name>: <header1_value>,
                  <header2_name>: <header2_value>
              }
Returns:

A promise which will be resolved with the data or rejected if an error occurs.

Type
String

(static) patch(url, optionsopt) → {String}

Patches data to a URL.

Parameters:
Name Type Attributes Description
url String

URL from which to get the data.

options Object <optional>

Optional parameters

Properties
Name Type Attributes Description
headers Object <optional>

Map of headers to add to the request. Format:

              {
                  <header1_name>: <header1_value>,
                  <header2_name>: <header2_value>
              }
body Object <optional>

Body to send with request

Returns:

A promise which will be resolved with the data or rejected if an error occurs.

Type
String

(static) post(url, optionsopt) → {String}

Posts data to a URL.

Parameters:
Name Type Attributes Description
url String

URL from which to get the data.

options Object <optional>

Optional parameters

Properties
Name Type Attributes Description
headers Object <optional>

Map of headers to add to the request. Format:

              {
                  <header1_name>: <header1_value>,
                  <header2_name>: <header2_value>
              }
body Object <optional>

Body to send with request

Returns:

A promise which will be resolved with the data or rejected if an error occurs.

Type
String

(static) put(url, optionsopt) → {String}

Puts data to a URL.

Parameters:
Name Type Attributes Description
url String

URL from which to get the data.

options Object <optional>

Optional parameters

Properties
Name Type Attributes Description
headers Object <optional>

Map of headers to add to the request. Format:

              {
                  <header1_name>: <header1_value>,
                  <header2_name>: <header2_value>
              }
body Object <optional>

Body to send with request

Returns:

A promise which will be resolved with the data or rejected if an error occurs.

Type
String