\r\n

51Degrees Pipeline Node.js  4.4

51Degrees Pipeline for Node.js

RequestClient Class Reference

Public Member Functions

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

Member Function Documentation

◆ get()

RequestClient::get (   url,
  origin  
)
inline

Make a GET request to the specified url.

Parameters
{*} - url The url to send a request to
{*} - origin The value to use for the Origin header when making the request
Returns
a 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
{*} - url The url to send a request to
{*} - data The data to send in the body of the request
{*} - origin The value to use for the Origin header when making the request
Returns
a 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