Advanced Alerting APIs
HttpClient Interface Reference

Provides an API to perform HTTP POST and GET operations. More...

List of all members.

Public Member Functions

HttpResponse get (object request)
HttpResponse post (object request)
HttpResponse put (object request)
HttpResponse delete (object request)

Detailed Description

Provides an API to perform HTTP POST and GET operations.

Author:
Matt Rodriguez

Member Function Documentation

HttpResponse delete ( object  request)

Perform an HTTP DELETE request

Parameters:
requestA Javascript object which must contain the url and may contain:
  • username
  • password
  • headers

The username and password attributes are strings, if supplied, the request will perform Basic Authentication. The headers attribute is another Javascript object with key value pairs for each header.

Returns:
A HttpResponse object, which contains the status code, content, headers, and cookies.
HttpResponse get ( object  request)

Perform an HTTP GET request

Parameters:
requestA Javascript object which must contain the url and may contain:
  • username
  • password
  • headers

The username and password attributes are strings, if supplied, the request will perform Basic Authentication. The headers attribute is another Javascript object with key value pairs for each header.

Returns:
A HttpResponse object, which contains the status code, content, headers, and cookies.
HttpResponse post ( object  request)

Perform an HTTP POST request

Parameters:
requestA Javascript object which must contain the attributes url and data, and may contain:
  • username
  • password
  • headers
  • contentType

The data attribute is a Javascript object, which is encoded and sent in the body of the POST request. The username and password attributes are strings, if supplied, the request will perform Basic Authentication. The headers attribute is a Javascript object which contains the name value pairs for each header. The contentType attribute is a string which contains the content type. The supported content types are:

  • application/x-www-form-urlencoded
  • application/json

If contentType is not supplied then it is assumed to be application/x-www-form-urlencoded.

Returns:
A HttpResponse object, which contains the status code, content, headers, and cookies
HttpResponse put ( object  request)

Perform an HTTP PUT request

Parameters:
requestA Javascript object which must contain the attributes url and data, and may contain:
  • username
  • password
  • headers
  • contentType

The data attribute is a Javascript object, which is encoded and sent in the body of the POST request. The username and password attributes are strings, if supplied, the request will perform Basic Authentication. The headers attribute is a Javascript object which contains the name value pairs for each header. The contentType attribute is a string which contains the content type. The supported content types are:

  • application/x-www-form-urlencoded
  • application/json

If contentType is not supplied then it is assumed to be application/x-www-form-urlencoded.

Returns:
A HttpResponse object, which contains the status code, content, headers, and cookies
 All Classes Functions