Skip to main content

HTTP Request

Type ID: core.http  ·  Kind: Action  ·  Trace: TOOL

Makes an HTTP request to any URL using axios. Supports method selection, query parameters, headers, several body content types, basic/bearer authentication, and JSON or text response parsing.

Credentials

None

Properties

PropertyKeyTypeRequiredDefaultPossible valuesShown when
MethodmethodoptionsYesGETGET, POST, PUT, PATCH, DELETE, HEAD, OPTIONSAlways
URLurlstringYes''Full URL (e.g. https://api.example.com/endpoint)Always
AuthenticationauthenticationoptionsNononenone — None; bearerToken — Bearer Token; basicAuth — Basic AuthAlways
Bearer TokenbearerTokenstringNo''Bearer token stringauthentication = bearerToken
UsernameusernamestringNo''Basic-auth usernameauthentication = basicAuth
PasswordpasswordstringNo''Basic-auth passwordauthentication = basicAuth
Query ParametersqueryParametersobjectNo{}Key/value object appended to the URLAlways
HeadersheadersobjectNo{}Key/value object of HTTP headers (values coerced to string)Always
Body Content TypebodyContentTypeoptionsNojsonjson — JSON; form — Form Data; form-urlencoded — Form URL-Encoded; raw — RawAlways
BodybodystringNo''Request body for POST/PUT/PATCH. JSON object/string for JSON and form typesAlways
Response FormatresponseFormatoptionsNojsonjson — JSON; text — Text; autodetect — Auto DetectAlways
OptionsoptionsobjectNo{}Collection of request options (see below)Always

Options (nested fields)

FieldKeyTypeDefaultDescription
Timeouttimeoutnumber30000Request timeout in milliseconds
Follow RedirectsfollowRedirectsbooleantrueWhether to follow HTTP redirects
Ignore SSL IssuesignoreSSLbooleanfalseWhether to ignore SSL certificate errors

Notes

  • Parameters are resolved through the resolver engine before execution, so expressions are supported. A missing url throws URL is required for HTTP request.
  • Request is issued with axios. timeout defaults to 30000 ms; maxRedirects is 0 when followRedirects is false, otherwise 5. When ignoreSSL is true an https.Agent with rejectUnauthorized: false is attached.
  • Authentication: bearerToken sets an Authorization: Bearer <token> header; basicAuth sets axios auth from username/password. none adds nothing.
  • Body is only sent for POST, PUT, PATCH (and only when body is truthy). json parses string bodies via JSON.parse (invalid JSON throws) and sets Content-Type: application/json. form/form-urlencoded build URLSearchParams from a parsed object and set Content-Type: application/x-www-form-urlencoded. raw sends the body unchanged.
  • Response format text stringifies non-string responses; json and autodetect pass axios's parsed data through.
  • On success the single output item is { statusCode, statusMessage, headers, body }. On failure an error item is built (error: true, statusCode, statusMessage, headers, body, message) but the node then throws HTTP Request failed (<status>): <message> rather than returning it.