File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
examples/data-sources/http Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,22 @@ data "http" "example" {
4242 Accept = "application/json"
4343 }
4444}
45+
46+ # The following example shows how to issue an HTTP HEAD request.
47+ data "http" "example_head" {
48+ url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"
49+ method = "HEAD"
50+ }
51+
52+ # The following example shows how to issue an HTTP POST request
53+ # supplying an optional request body.
54+ data "http" "example_post" {
55+ url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"
56+ method = "POST"
57+
58+ # Optional request body
59+ request_body = "request body"
60+ }
4561```
4662
4763## Usage with Postcondition
Original file line number Diff line number Diff line change @@ -8,3 +8,19 @@ data "http" "example" {
88 Accept = " application/json"
99 }
1010}
11+
12+ # The following example shows how to issue an HTTP HEAD request.
13+ data "http" "example_head" {
14+ url = " https://checkpoint-api.hashicorp.com/v1/check/terraform"
15+ method = " HEAD"
16+ }
17+
18+ # The following example shows how to issue an HTTP POST request
19+ # supplying an optional request body.
20+ data "http" "example_post" {
21+ url = " https://checkpoint-api.hashicorp.com/v1/check/terraform"
22+ method = " POST"
23+
24+ # Optional request body
25+ request_body = " request body"
26+ }
You can’t perform that action at this time.
0 commit comments