Update content/resources/how-to-guides/reduce-to-construct-JSON.md

pull/4160/head
kelseiv 2022-07-07 10:41:10 -07:00 committed by GitHub
parent f2437339f3
commit b010101987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ weight: 105
---
## Send data in JSON body with `http.post()`
Use the [reduce()](/flux/v0.x/stdlib/universe/reduce/) function to create a JSON object and include it as the body with the `http.post()` function.
Use the [reduce()](/flux/v0.x/stdlib/universe/reduce/) function to create a JSON object to include as the body with `http.post()`.
1. Boilerplate. Import packages. The [array](/flux/v0.x/stdlib/array/) package is used to construct tables so you can run this script yourself. The [http package](/flux/v0.x/stdlib/http/) is used to transfer the JSON over http.
2. Use `array.from()` to query data and construct a table. Or, use another method [to query data with Flux](/influxdb/v2.3/query-data/flux/).