Bu eylemler, standart kütüphanenin bir parçası olarak tüm Runbook'larda kullanılabilir.
send_http_request
std::send_http_request eylemi, belirtilen URL'ye bir HTTP isteği gönderir.
Girdiler
| Ad | Zorunlu | Tür | Açıklama |
|---|---|---|---|
url | zorunlu | string | İsteğin gönderileceği URL |
method | isteğe bağlı | string | HTTP metodu (GET, POST, PUT, DELETE). Varsayılan: GET |
headers | isteğe bağlı | map | İsteğe eklenecek HTTP başlıkları |
body | isteğe bağlı | string | İstek gövdesi (POST/PUT istekleri için) |
timeout_ms | isteğe bağlı | integer | Milisaniye cinsinden istek zaman aşımı |
Çıktılar
| Ad | Tür | Açıklama |
|---|---|---|
status_code | integer | HTTP durum kodu |
body | string | Yanıt gövdesi |
headers | map | Yanıt başlıkları |
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 İsteği Örneği
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?