Documentation function makes a http POST request. This identical to calling "POST", ...).

Function type signature
    url: string,
    ?body: bytes,
    ?config: {A with timeout: duration, insecureSkipVerify: bool},
    ?headers: [string:string],
    ?params: [string:[string]],
) => {statusCode: int, headers: [string:string], duration: duration, body: bytes}
For more information, see Function type signatures.



(Required) URL to request. This should not include any query parameters.


Set of key value pairs to add to the URL as query parameters. Query parameters will be URL encoded. All values for a key will be appended to the query.


Set of key values pairs to include on the request.


Data to send with the request.


Set of options to control how the request should be performed.


Make a POST request with a JSON body and decode JSON response

import "http/requests"
import ejson "experimental/json"
import "json"
import "array"

response =
        url: "",
        body: json.encode(v: {url: ""}),
        headers: ["Content-Type": "application/json"],

data = ejson.parse(data: response.body)

array.from(rows: [data])

View example output

Make a POST request with query parameters

import "http/requests"

response = "", params: ["start": ["100"], "interval": ["1h", "1d"]])

// Full URL:
requests.peek(response: response)

View example output

Was this page helpful?

Thank you for your feedback!

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.