Skip to content

HTTP & Network Modules

HTTP & Network Modules

cURL β€” HTTP Requests

The curl module makes HTTP requests to any endpoint. It is the primary module for REST API integration.

appId: curl

{
"appId": "curl",
"ref": "callApi",
"args": {
"method": "POST",
"url": "https://api.example.com/v1/orders",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {{ $kv.get 'apiToken' }}"
},
"body": {
"orderId": "{{ $prev.args.orderId }}",
"amount": "{{ $prev.calcTotal.amount }}"
},
"timeout": 30,
"followRedirects": true,
"responseType": "json"
}
}

Arguments:

ArgTypeDescription
methodstringHTTP method: GET, POST, PUT, PATCH, DELETE
urlstringFull URL including query params
headersmapRequest headers (key/value)
bodyanyRequest body β€” object (sent as JSON), string (sent raw)
bodyFormmapForm-encoded body (application/x-www-form-urlencoded)
timeoutintRequest timeout in seconds (default: 30)
followRedirectsboolFollow 3xx redirects (default: true)
responseTypestringjson (parse body), text (raw string), binary (base64)
basicAuthobject{"user":"...","pass":"..."} for Basic auth
bearerTokenstringShorthand for Authorization Bearer header

Output:

{
"statusCode": 200,
"body": { "id": "ord-123", "status": "created" },
"headers": { "content-type": "application/json" },
"duration": 342
}

Common patterns:

// GET with query params
{
"method": "GET",
"url": "https://api.example.com/users?page={{ $prev.args.page }}&limit=25"
}
// POST with form data
{
"method": "POST",
"url": "https://auth.example.com/token",
"bodyForm": {
"grant_type": "client_credentials",
"client_id": "{{ $kv.get 'clientId' }}",
"client_secret": "{{ $kv.get 'clientSecret' }}"
}
}
// Check for non-200 in downstream filter
// filter: { "leftValue": "{{ $prev.callApi.statusCode }}", "operator": "eq", "rightValue": "200" }

Wget β€” File Download

Downloads a file from a URL and saves it to storage.

appId: wget

{
"appId": "wget",
"ref": "downloadFile",
"args": {
"url": "https://example.com/report.pdf",
"destination": "reports/{{ $prev.args.reportId }}.pdf",
"headers": {
"Authorization": "Bearer {{ $kv.get 'token' }}"
}
}
}

Output: { "path": "reports/12345.pdf", "size": 204800, "mimeType": "application/pdf" }

The saved path is relative to the company’s storage root and can be passed to PDF, OCR, or other storage modules.