updated http.get to address PR review, updated http.get example
parent
19af0a7ec3
commit
8dd20a8ed7
|
@ -2,8 +2,8 @@
|
||||||
title: Flux HTTP package
|
title: Flux HTTP package
|
||||||
list_title: HTTP package
|
list_title: HTTP package
|
||||||
description: >
|
description: >
|
||||||
The Flux Experimental HTTP package provides experimental functions for transferring
|
The Flux Experimental HTTP package provides functions for transferring data
|
||||||
data using the HTTP protocol.
|
using HTTP protocol.
|
||||||
Import the `experimental/http` package.
|
Import the `experimental/http` package.
|
||||||
menu:
|
menu:
|
||||||
v2_0_ref:
|
v2_0_ref:
|
||||||
|
@ -14,8 +14,8 @@ weight: 201
|
||||||
v2.0/tags: [functions, http, package]
|
v2.0/tags: [functions, http, package]
|
||||||
---
|
---
|
||||||
|
|
||||||
The Flux Experimental HTTP package provides experimental functions for transferring
|
The Flux Experimental HTTP package provides functions for transferring data
|
||||||
data using the HTTP protocol.
|
using HTTP protocol.
|
||||||
|
|
||||||
{{% warn %}}
|
{{% warn %}}
|
||||||
The experimental HTTP package is subject to change at any time.
|
The experimental HTTP package is subject to change at any time.
|
||||||
|
|
|
@ -38,6 +38,7 @@ _**Data type:** String_
|
||||||
|
|
||||||
### headers
|
### headers
|
||||||
Headers to include with the GET request.
|
Headers to include with the GET request.
|
||||||
|
Headers are represented by key-value pairs.
|
||||||
|
|
||||||
_**Data type:** Object_
|
_**Data type:** Object_
|
||||||
|
|
||||||
|
@ -45,11 +46,14 @@ _**Data type:** Object_
|
||||||
|
|
||||||
##### Get the status of InfluxDB
|
##### Get the status of InfluxDB
|
||||||
```js
|
```js
|
||||||
|
import "influxdata/influxdb/secrets"
|
||||||
import "experimental/http"
|
import "experimental/http"
|
||||||
|
|
||||||
|
token = secrets.get(key: "READONLY_TOKEN")
|
||||||
|
|
||||||
response = http.get(
|
response = http.get(
|
||||||
url: "http://localhost.com:9999/health",
|
url: "http://localhost.com:9999/health",
|
||||||
headers: {}
|
headers: {Authorization: "Token ${token}"}
|
||||||
)
|
)
|
||||||
|
|
||||||
status = string(v: response.statusCode)
|
status = string(v: response.statusCode)
|
||||||
|
|
Loading…
Reference in New Issue