HTTP Client
An HTTP client operator capable of sending arbitrary HTTP requests, polling a URL and, posting JSON data.
Configuration Parameters
Parameter |
Type |
Description |
---|---|---|
postUrl |
string |
The URL to which data from the in port is posted. This property can only be empty if the in port is not connected. Default: "http://localhost:7070" |
getUrl |
string |
The URL to be polled for data with GET requests. Default: "http://localhost:7070" |
getPeriodInMs |
int |
The period in milliseconds to be used for polling getUrl. Default: 1000 |
numRetryAttempts |
int |
The number of times to retry a failed request. Default: 0 |
requestTimeoutInMs |
int |
The number of milliseconds to wait for a response before timing out. Default: 5000 |
retryPeriodInMs |
int |
The number of milliseconds to wait between consecutive retry
attempts.
Default: 0 |
Proxy |
string |
A URL to be used as proxy server. If empty, the client will fallback to the system's configuration (HTTP_PROXY and HTTPS_PROXY environment variables and their lower-case counterparts). |
Input
Input |
Type |
Description |
---|---|---|
in |
blob |
The input JSON data that will be posted to postUrl. |
inRequest |
message |
A message specifying a custom HTTP request to be sent. The message must contain attributes http.url (destination address) and http.method (the HTTP method for the request). The request will obey the values given to numRetryAttempts, requestTimeoutInMs and retryPeriodInMs. HTTP Header Fields:
|
Output
Output |
Type |
Description |
---|---|---|
out |
blob |
The output data in JSON format. |
outResponse |
message |
The complete response given by the remote peer. The message will
contain the following attributes:
|
Error Handling
- If port outResponse is connected:
- If an error occurred and no response was received, an error is thrown.
- If a response was received, it will be written to this port regardless of the contained HTTP status.
- The user is free to decide on the appropriate treatment for each HTTP status by reading it from the http.status and http.statusCode message attributes.
- If port outResponse is not connected, then this operator will throw an error itself if the request failed or if the status in the remote peer's response is anything other than HTTP OK (200).
- Port out does not affect the above error handling policy, and the body of a response will only be written to this port if the status was HTTP OK (200).
TLS Certificates
Due to limited filesystem manipulation capabilities, the HTTP Client will automatically load and use any certificate files in its directory that have the .crt extension. To upload a certificate, use the Repository tab, browse to the HTTP Client's editor page and use the Upload Auxiliary File button.