Making an HTTP Request
Making a Request
This input will make a HTTP request - by default ‘GET’.
A useful testing URL is https://httpbin.org/anything
, because it will return exactly what it received in the request.
First, set Url
to this.
It will return a single JSON document, formatted over multiple lines, so the first thing we need to do is set JSON
and Ignore Line Breaks
to both being true, since the default is false.
To quickly see the result, click on the Run & Trace
button on the the top left.
The result will appear on the right hand size next to the editor items:
We can now add various items to the request:
- set new
Headers
- set
Query
- set
Body
Streaming Data
It is common for inputs to return multiple lines, each representing a single event
For instance, if the Url
is https://httpbin.org/stream/5
then we get 5 JSON objects.
So JSON
must be enabled, but not Ignore Line Breaks
.
Each one of these events will pass through all the steps; if you click Run
and go to Run Output
then you will see each event has an added time field from the Time
action.
Repeating the Request
The next step is scheduling it to happen more than once - select Trigger
and then Interval
.
There are two time-based ways to schedule jobs - this is a simple duration expressed in human units (for instance “5h” etc.) If you need to run a job at precise times like on the hour, then Cron
is preferred.
You can safely hit Run
because these transient jobs will always end:
- the event limit was reached
- the time limit was reached
- there was an error
- the job was cancelled
Click the Run Output
button, and click Run
:
Notice the Run time limit
and the Output event limit
.
If left alone, our scheduled job will end when 10 seconds is up - the default run time limit. We will get 5 events, as expected.
While running, the Cancel Job
button is active and can be used to bail out at any time.