mirror of https://github.com/hashicorp/packer
This adds support for additional http methods for the http datasource. Fixes #13169 Signed-off-by: Henrik Gerdes <hegerdes@outlook.de>pull/13197/head
parent
6e417bb883
commit
6c40bfb0cd
@ -0,0 +1,26 @@
|
||||
source "null" "example" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
data "http" "basic" {
|
||||
url = "https://www.packer.io/"
|
||||
method = "NONEEXISTING"
|
||||
}
|
||||
|
||||
locals {
|
||||
url = "${data.http.basic.url}"
|
||||
body = "${data.http.basic.body}" != ""
|
||||
}
|
||||
|
||||
build {
|
||||
name = "mybuild"
|
||||
sources = [
|
||||
"source.null.example"
|
||||
]
|
||||
provisioner "shell-local" {
|
||||
inline = [
|
||||
"echo url is ${local.url}",
|
||||
"echo body is ${local.body}"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,9 @@
|
||||
<!-- Code generated from the comments of the Config struct in datasource/http/data.go; DO NOT EDIT MANUALLY -->
|
||||
|
||||
- `method` (string) - HTTP method used for the request. Supported methods are `HEAD`, `GET`, `POST`, `PUT`, `DELETE`, `OPTIONS`, `PATCH`. Default is `GET`.
|
||||
|
||||
- `request_headers` (map[string]string) - A map of strings representing additional HTTP headers to include in the request.
|
||||
|
||||
- `request_body` (string) - HTTP request payload send with the request. Default is empty.
|
||||
|
||||
<!-- End of code generated from the comments of the Config struct in datasource/http/data.go; -->
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<!-- Code generated from the comments of the Config struct in datasource/http/data.go; DO NOT EDIT MANUALLY -->
|
||||
|
||||
- `url` (string) - The URL to request data from. This URL must respond with a `200 OK` response and a `text/*` or `application/json` Content-Type.
|
||||
- `url` (string) - The URL to request data from. This URL must respond with a `2xx` range response code and a `text/*` or `application/json` Content-Type.
|
||||
|
||||
<!-- End of code generated from the comments of the Config struct in datasource/http/data.go; -->
|
||||
|
||||
Loading…
Reference in new issue