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