fix(api): curl --user syntax

pull/6194/head
Jason Stirnaman 2025-07-08 00:31:49 -05:00
parent f349f3fa04
commit e92c82129a
6 changed files with 8 additions and 8 deletions

View File

@ -117,7 +117,7 @@ The following example:
##############################################################################
curl --get "http://{{< influxdb/host >}}/query" \
--user "INFLUX_USERNAME":"INFLUX_PASSWORD_OR_TOKEN" \
--user "INFLUX_USERNAME:INFLUX_PASSWORD_OR_TOKEN" \
--data-urlencode "db=BUCKET_NAME" \
--data-urlencode "q=SELECT * FROM cpu_usage"
```
@ -139,7 +139,7 @@ curl --get "http://{{< influxdb/host >}}/query" \
curl \
--request POST \
"http://{{< influxdb/host >}}/query?db=DATABASE_NAME&rp=RETENTION_POLICY" \
--user "INFLUX_USERNAME":"INFLUX_PASSWORD_OR_TOKEN" \
--user "INFLUX_USERNAME:INFLUX_PASSWORD_OR_TOKEN" \
--header "Content-type: application/vnd.influxql" \
--data "SELECT * FROM cpu_usage WHERE time > now() - 1h"
```

View File

@ -113,7 +113,7 @@ scheme and a [database token](/influxdb3/cloud-dedicated/admin/tokens/#database-
curl --get "https://{{< influxdb/host >}}/query" \
--user "":"DATABASE_TOKEN" \
--user "any:DATABASE_TOKEN" \
--data-urlencode "db=DATABASE_NAME" \
--data-urlencode "q=SELECT * FROM MEASUREMENT"
```

View File

@ -20,7 +20,7 @@ list_code_example: |
<!-- pytest.mark.skip -->
```sh
curl "https://{{< influxdb/host >}}/query" \
--user "":"API_TOKEN" \
--user "any:API_TOKEN" \
--data-urlencode "db=DATABASE_NAME" \
--data-urlencode "rp=RETENTION_POLICY" \
--data-urlencode "q=SELECT * FROM MEASUREMENT"
@ -97,7 +97,7 @@ The following example shows how to use cURL with the `Basic` authentication sche
#######################################
curl "https://{{< influxdb/host >}}/query" \
--user ":API_TOKEN" \
--user "any:API_TOKEN" \
--data-urlencode "db=DATABASE_NAME" \
--data-urlencode "rp=RETENTION_POLICY" \
--data-urlencode "q=SELECT * FROM MEASUREMENT"

View File

@ -104,7 +104,7 @@ The following example shows how to use cURL with the `Basic` authentication sche
{{% code-placeholders "DATABASE_NAME|DATABASE_TOKEN" %}}
```sh
curl --get "https://{{< influxdb/host >}}/query" \
--user "":"DATABASE_TOKEN" \
--user "any:DATABASE_TOKEN" \
--data-urlencode "db=DATABASE_NAME" \
--data-urlencode "q=SELECT * FROM MEASUREMENT"
```

View File

@ -60,7 +60,7 @@ The following example shows how to use cURL with the `Basic` authentication sche
{{% code-placeholders "DATABASE_NAME|DATABASE_TOKEN" %}}
```sh
curl --get "https://{{< influxdb/host >}}/query" \
--user "":"DATABASE_TOKEN" \
--user "any:DATABASE_TOKEN" \
--data-urlencode "db=DATABASE_NAME" \
--data-urlencode "q=SELECT * FROM home"
```

View File

@ -132,7 +132,7 @@ The following example shows how to use cURL with the `Basic` authentication sche
{{% code-placeholders "DATABASE_NAME|DATABASE_TOKEN" %}}
```sh
curl -i "https://{{< influxdb/host >}}/write?db=DATABASE_NAME&precision=s" \
--user "":"DATABASE_TOKEN" \
--user "any:DATABASE_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary 'home,room=kitchen temp=72 1641024000'
```