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:
| Arg | Type | Description |
|---|---|---|
method | string | HTTP method: GET, POST, PUT, PATCH, DELETE |
url | string | Full URL including query params |
headers | map | Request headers (key/value) |
body | any | Request body β object (sent as JSON), string (sent raw) |
bodyForm | map | Form-encoded body (application/x-www-form-urlencoded) |
timeout | int | Request timeout in seconds (default: 30) |
followRedirects | bool | Follow 3xx redirects (default: true) |
responseType | string | json (parse body), text (raw string), binary (base64) |
basicAuth | object | {"user":"...","pass":"..."} for Basic auth |
bearerToken | string | Shorthand 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.