51Degrees Pipeline for Node.js

RequestClient Class Reference

Public Member Functions

 post (url, data, origin)
 Make a POST request to the specified url.
 get (url, origin)
 Make a GET request to the specified url.

Member Function Documentation

◆ get()

RequestClient::get ( url,
origin )
inline

Make a GET request to the specified url.

Parameters
{string}url The url to send a request to
{string| null} origin The value to use for the Origin header when making the request
Returns
{Promise} The resolve function will be passed the content from the response and the reject function will be passed an object with 3 properties: headers = HTTP headers in the response statusCode = HTTP status code of response content = The content of the response or an error message

◆ post()

RequestClient::post ( url,
data,
origin )
inline

Make a POST request to the specified url.

Parameters
{string}url The url to send a request to
{object| null} data The data to send in the body of the request
{string| null} origin The value to use for the Origin header when making the request
Returns
{Promise} The resolve function will be passed the content from the response and the reject function will be passed an object with 3 properties: headers = HTTP headers in the response statusCode = HTTP status code of response content = The content of the response or an error message