SolanaドキュメントInfrastructure as Code標準ライブラリ

標準アクション

これらのアクションは、標準ライブラリの一部としてすべてのRunbookで利用できます。

send_http_request

std::send_http_request アクションは、指定されたURLにHTTPリクエストを送信します。

入力

名前必須説明
url必須stringリクエストの送信先URL
method任意stringHTTPメソッド(GET、POST、PUT、DELETE)。デフォルト: GET
headers任意mapリクエストに含めるHTTPヘッダー
body任意stringリクエストボディ(POST/PUTリクエスト用)
timeout_ms任意integerリクエストのタイムアウト(ミリ秒単位)

出力

名前説明
status_codeintegerHTTPステータスコード
bodystringレスポンスボディ
headersmapレスポンスヘッダー
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?

目次

ページを編集
© 2026 Solana Foundation. 無断転載を禁じます。