HTTP Client


The HTTP client node establishes an HTTP client that can call an API.

Node Type

External.

Input and Output Ability

This node has 1 entry point and 1 exit point. Both the input and the output can be any format.


The body is automatically output to msg while the header and attribute information is stored in the metadata, which can be queried by using ${metadata.key}, where key corresponds to the key of the header/attribute.

Node Properties

../../_images/http_client.png


Name

The name for this node.


Request Method

The request method this node uses to make a request to the server. Supports GET and POST.


URL

The URL of the HTTP server.


Timeout

The request timeout of this node. The unit is in millisecond and the default value is 30,000. If this node does not receive any response from the server within this timeout period, this request will timeout. The available timeout period is between 1,000 – 60,000 milliseconds.


Authentication Method

The method of how a request made by this node is authenticated. Possible values include the following.

  • Anonymous: Make an anonymous request by using a different IP address every time.

  • Username/Password: Pass the username/password in the request for authentication.


Params

The parameters attached to the URL of the request in the form of “?key=value”.


Headers

The key-value pairs included in the header of the request.


Keep Cookie

Keeps the cookie information for session management.


Description

The description for this node.

Limitations

  • As the HTTP server is not managed by EnOS, connection problems could occur due to server downtime or other instances that are not within our control.

Samples

Input Sample

If an HTTP client node requesting weather information of a specific place has the following configurations:

Field

Value

Name

HTTP Client

Request Method

GET

URL

https://api.openweathermap.org/data/2.5/weather

Timeout

None

Authentication

Anonymous

Params

zip: 95050
units: imperial
appid: 6d2d46f8ef16aad452df394b00e8ec45

Headers

None


Then it is equivalent to making an request as follows:

GET https://api.openweathermap.org/data/2.5/weather?zip=95050&units=imperial&appid=6d2d46f8ef16aad452df394b00e8ec45

Output Sample

Given the configuration above, the sample output returning the requested weather information is as follows:

{
  "MetaData":{
    "CamelHttpResponseCode": "200",
    "CamelHttpQuery": "",
    "CamelHttpResponseText": "OK"
  },
  "Body":{
    "coord":{
    "lon":-121.95,
    "lat":37.35
   },
   "weather":[
    {
      "id":721,
      "main":"Haze",
      "description":"haze",
      "icon":"50n"
    }
   ],
   "base":"stations",
   "main":{
    "temp":59.88,
    "feels_like":59.61,
    "temp_min":59,
    "temp_max":61,
    "pressure":1015,
    "humidity":77
   },
   "visibility":3219,
   "wind":{
    "speed":1.95,
    "deg":310
   },
   "clouds":{
    "all":90
   },
   "dt":1600071865,
   "sys":{
    "type":1,
    "id":5845,
    "country":"US",
    "sunrise":1600091374,
    "sunset":1600136217
   },
   "timezone":-25200,
   "id":0,
   "name":"Santa Clara",
   "cod":200
  }
}