http_step

Configure HTTP request.

HTTP requests are configured and performed with http_step resource.

Example

resource "http_step" "my_step" {
    method = "POST"
    url = "http://localhost/endpoint"
    body = <<<EOF
{
    "some": "data"
}
EOF

    headers = [
        "Content-Type", "application/json",
        "X-My-Header", "custom header value",
    ]

    assertions = [
        "${http_assertion.equals_200.id}",
    ]
}

Inputs

  • method — HTTP request method.
  • url — Request URL, must include scheme.
  • body (optional) — Request body.
  • headers (optional) — a list of request header values. Header value follows header name.
  • assertions (optional) — a list of assertions to perform on the response of the request.
  • variables (optional) — a list of variables to render before the request or capture from the response.

Outputs

  • id - resource ID.