Deze acties zijn beschikbaar in alle Runbooks als onderdeel van de standaardbibliotheek.
send_http_request
De actie std::send_http_request maakt een HTTP-verzoek naar de opgegeven URL.
Invoer
| Naam | Vereist | Type | Beschrijving |
|---|---|---|---|
url | vereist | string | De URL waarnaar het verzoek wordt gestuurd |
method | optioneel | string | De HTTP-methode (GET, POST, PUT, DELETE). Standaard: GET |
headers | optioneel | map | HTTP-headers om op te nemen in het verzoek |
body | optioneel | string | De verzoekbody (voor POST/PUT-verzoeken) |
timeout_ms | optioneel | integer | Verzoektime-out in milliseconden |
Uitvoer
| Naam | Type | Beschrijving |
|---|---|---|
status_code | integer | De HTTP-statuscode |
body | string | De responsbody |
headers | map | De responsheaders |
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}
Voorbeeld POST-verzoek
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?