이 액션들은 표준 라이브러리의 일부로 모든 Runbook에서 사용할 수 있습니다.
send_http_request
std::send_http_request 액션은 지정된 URL로 HTTP 요청을 보냅니다.
입력
| 이름 | 필수 여부 | 타입 | 설명 |
|---|---|---|---|
url | 필수 | string | 요청을 보낼 URL |
method | 선택 | string | HTTP 메서드 (GET, POST, PUT, DELETE). 기본값: GET |
headers | 선택 | map | 요청에 포함할 HTTP 헤더 |
body | 선택 | string | 요청 본문 (POST/PUT 요청용) |
timeout_ms | 선택 | integer | 요청 타임아웃 (밀리초) |
출력
| 이름 | 타입 | 설명 |
|---|---|---|
status_code | integer | HTTP 상태 코드 |
body | string | 응답 본문 |
headers | map | 응답 헤더 |
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 요청 예시
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?