updated http.get to address PR review, updated http.get example

pull/620/head
Scott Anderson 2019-11-20 09:43:14 -07:00
parent 19af0a7ec3
commit 8dd20a8ed7
2 changed files with 9 additions and 5 deletions

View File

@ -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.

View File

@ -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)