Everlive.Http.request

Everlive.Http.request

Signature

Everlive.Http.request(method, url, [options], done)

Description

Performs an HTTP(S) request with the specified parameters.

Parameters

Parameter Name Type Description
method string Request method to use. Must be a valid HTTP verb such as GET, POST, and so on.
url string Request URL.
[options] HttpModule.Options An object containing data specific to the requested URL.
callback function A function that is invoked after the request completes. It receives two arguments: one for the error and one for the result. If the request is successful, the first argument is null
  • options:

    • params—An HTTP query string parameters that will be concatenated to the url in ?paramA=value&paramB=value format. Default value: {}. Example: {foo: 'bar', baz: 'qux'}
    • headers—An object containing custom headers. Default value: null. Example: {X-Everlive-Skip: '3', X-Everlive-Take: '10'}
    • body—An object containing the request body. Default value: null.
    • contentTypeContent-Type header of the requests. Default value: null.
    • acceptsAccept header of the requests. Default value: null.
    • rejectUnauthorized—Specifies whether to check the SSL certificate of the remote server against the list of certificate authorities. For example, set this to false when you need to communicate with a web service encrypted with a self-signed certificate. Default value: true.
  • callback arguments:

    • The error object has the following fields:
      • message—A message describing the error.
      • code—The error code of the response.
      • name—The name of the error.
    • The result object has the following fields:
      • statusCode—The HTTP status code of the response.
      • body—The body of the response as a string.
      • data—The body of the response as a JavaScript object. This field is set only if the Content-Type is recognized and supported.
      • headers—The headers of the response as a JavaScript object. Example: response.headers['Content-Type'].
Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.