content/flux/v0/stdlib/experimental/http/get.md
http.get() submits an HTTP GET request to the specified URL and returns the HTTP
status code, response body, and response headers.
{{% warn %}}
Experimental http.get() is deprecated in favor of requests.get().
{{% /warn %}}
http.get() returns a record with the following properties:
(url: string, ?headers: A, ?timeout: duration) => {statusCode: int, headers: B, body: bytes} where A: Record, B: Record
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
({{< req >}}) URL to send the GET request to.
Headers to include with the GET request.
Timeout for the GET request. Default is 30s.
import "experimental/http"
http.get(
url: "http://localhost:8086/health",
headers: {Authorization: "Token mY5up3RS3crE7t0k3N", Accept: "application/json"},
)