DataJet
Search…
http
http filter will call an endpoint of your choice and capture the response.

Example

We are going to call a dummy endpoint with following parameters:
1
POST https://dummy.api
2
Headers
3
Content-Type: application/json
4
Body
5
{
6
"foo": "bar"
7
}
Copied!
Using http filter it will look like that:
Liquid
1
{% assign endpoint = "https://dummy.api" %}
2
3
{% capture request_options %}
4
{
5
"url": {{ endpoint | json }},
6
"method": "POST",
7
"headers": {
8
"Content-Type": "application/json"
9
},
10
"body": {
11
"foo": "bar"
12
}
13
}
14
{% endcapture %}
15
16
{% assign response = request_options | http %}
17
{% if response.ok %}
18
{{ "Success!" | log }}
19
{% else %}
20
{{ "Fail!" | log }}
21
{% endif %}
Copied!
Last modified 10mo ago
Copy link
Contents