github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/http/data_source.html.md (about)

     1  ---
     2  layout: "http"
     3  page_title: "HTTP Data Source"
     4  sidebar_current: "docs-http-data-source"
     5  description: |-
     6    Retrieves the content at an HTTP or HTTPS URL.
     7  ---
     8  
     9  # `http` Data Source
    10  
    11  The `http` data source makes an HTTP GET request to the given URL and exports
    12  information about the response.
    13  
    14  The given URL may be either an `http` or `https` URL. At present this resource
    15  can only retrieve data from URLs that respond with `text/*` or
    16  `application/json` content types, and expects the result to be UTF-8 encoded
    17  regardless of the returned content type header.
    18  
    19  ~> **Important** Although `https` URLs can be used, there is currently no
    20  mechanism to authenticate the remote server except for general verification of
    21  the server certificate's chain of trust. Data retrieved from servers not under
    22  your control should be treated as untrustworthy.
    23  
    24  ## Example Usage
    25  
    26  ```hcl
    27  data "http" "example" {
    28    url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"
    29  
    30    # Optional request headers
    31    request_headers {
    32      "Accept" = "application/json"
    33    }
    34  }
    35  ```
    36  
    37  ## Argument Reference
    38  
    39  The following arguments are supported:
    40  
    41  * `url` - (Required) The URL to request data from. This URL must respond with
    42    a `200 OK` response and a `text/*` or `application/json` Content-Type.
    43  
    44  * `request_headers` - (Optional) A map of strings representing additional HTTP
    45    headers to include in the request.
    46  
    47  ## Attributes Reference
    48  
    49  The following attributes are exported:
    50  
    51  * `body` - The raw body of the HTTP response.