These actions are available in all Runbooks as part of the standard library.
send_http_request
The std::send_http_request action makes an HTTP request to the specified URL.
Inputs
| Name | Required | Type | Description |
|---|---|---|---|
url | required | string | The URL to send the request to |
method | optional | string | The HTTP method (GET, POST, PUT, DELETE). Default: GET |
headers | optional | map | HTTP headers to include in the request |
body | optional | string | The request body (for POST/PUT requests) |
timeout_ms | optional | integer | Request timeout in milliseconds |
Outputs
| Name | Type | Description |
|---|---|---|
status_code | integer | The HTTP status code |
body | string | The response body |
headers | map | The response headers |
action "api_call" "std::send_http_request" {description = "Fetch data from API"url = "https://api.example.com/data"method = "GET"headers = {"Authorization" = "Bearer ${variable.token}"}}output "response" {value = action.api_call.body}output "status" {value = action.api_call.status_code}
POST Request Example
action "create_resource" "std::send_http_request" {description = "Create a new resource"url = "https://api.example.com/resources"method = "POST"headers = {"Content-Type" = "application/json"}body = {"name" = variable.name,"value" = variable.value}}
Is this page helpful?