Diese Aktionen sind in allen Runbooks als Teil der Standardbibliothek verfügbar.
send_http_request
Die Aktion std::send_http_request sendet eine HTTP-Anfrage an die angegebene
URL.
Eingaben
| Name | Erforderlich | Typ | Beschreibung |
|---|---|---|---|
url | erforderlich | string | Die URL, an die die Anfrage gesendet werden soll |
method | optional | string | Die HTTP-Methode (GET, POST, PUT, DELETE). Standard: GET |
headers | optional | map | HTTP-Header, die in der Anfrage enthalten sein sollen |
body | optional | string | Der Anfrage-Body (für POST/PUT-Anfragen) |
timeout_ms | optional | integer | Anfrage-Timeout in Millisekunden |
Ausgaben
| Name | Typ | Beschreibung |
|---|---|---|
status_code | integer | Der HTTP-Statuscode |
body | string | Der Antwort-Body |
headers | map | Die Antwort-Header |
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-Anfrage Beispiel
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?