Makes an HTTP request to the integrator.io API.
The options argument contains the following properties:
-
method <String>
– the HTTP method to use; defaults to GET if unspecified -
relativeURI <String, required>
– the URI relative to api.integrator.io; for ex. v1/connections -
qs <Object>
– a plain object representing the querystring key-value pairs to be appended to relativeURI -
headers <Object>
– a plain object representing the key-value pairs to be appended to the HTTP headers -
body <Object>
– the HTTP request body
The response object contains the following properties:
-
statusCode <Number>
– the HTTP status code -
headers <Object>
– the headers object contains all HTTP response headers, which can be accessed as follows:-
headers.headerName
– accessor to get a specific header value; headerName is case-insensitive -
headers()
– function to return all headers
-
-
body <Object>
– the HTTP response body
This function throws an error only if the HTTP request could not be completed, such as when the options argument was invalid or there was a timeout (the remote server took too long to respond or the response takes too long to transmit).
Note that 5xx and 4xx HTTP response code errors do not result in an error from this function; the code is passed through in the response object.
Comments
Please sign in to leave a comment.