diff --git a/docs/en/14-reference/02-rest-api/02-rest-api.mdx b/docs/en/14-reference/02-rest-api/02-rest-api.mdx index da26b34c6f77861a5a2308204dba56964ce05430..09e40b956f9a3b713335bec768fd1d5474f4bea1 100644 --- a/docs/en/14-reference/02-rest-api/02-rest-api.mdx +++ b/docs/en/14-reference/02-rest-api/02-rest-api.mdx @@ -67,7 +67,7 @@ The following return value results indicate that the verification passed. ## HTTP request URL format ```text -http://:/rest/sql/[db_name] +http://:/rest/sql/[db_name][?tz=timezone] ``` Parameter Description: @@ -75,6 +75,7 @@ Parameter Description: - fqnd: FQDN or IP address of any host in the cluster. - port: httpPort configuration item in the configuration file, default is 6041. - db_name: Optional parameter that specifies the default database name for the executed SQL command. +- tz: Optional parameter that specifies the timezone of the returned time, following the IANA Time Zone rules, e.g. `America/New_York`. For example, `http://h1.taos.com:6041/rest/sql/test` is a URL to `h1.taos.com:6041` and sets the default database name to `test`. @@ -97,13 +98,13 @@ The HTTP request's BODY is a complete SQL command, and the data table in the SQL Use `curl` to initiate an HTTP request with a custom authentication method, with the following syntax. ```bash -curl -L -H "Authorization: Basic " -d "" :/rest/sql/[db_name] +curl -L -H "Authorization: Basic " -d "" :/rest/sql/[db_name][?tz=timezone] ``` or ```bash -curl -L -u username:password -d "" :/rest/sql/[db_name] +curl -L -u username:password -d "" :/rest/sql/[db_name][?tz=timezone] ``` where `TOKEN` is the string after Base64 encoding of `{username}:{password}`, e.g. `root:taosdata` is encoded as `cm9vdDp0YW9zZGF0YQ==`.. diff --git a/docs/zh/08-connector/02-rest-api.mdx b/docs/zh/08-connector/02-rest-api.mdx index 68d73ff32f869dd9ae43093188be509c497b402f..af2ec1b1c2f2c677efa3e0a5c5ca2e16fa3c9b27 100644 --- a/docs/zh/08-connector/02-rest-api.mdx +++ b/docs/zh/08-connector/02-rest-api.mdx @@ -69,7 +69,7 @@ curl -L -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" \ ## HTTP 请求格式 ```text -http://:/rest/sql/[db_name] +http://:/rest/sql/[db_name][?tz=timezone] ``` 参数说明: @@ -77,6 +77,7 @@ http://:/rest/sql/[db_name] - fqdn: 集群中的任一台主机 FQDN 或 IP 地址。 - port: 配置文件中 httpPort 配置项,缺省为 6041。 - db_name: 可选参数,指定本次所执行的 SQL 语句的默认数据库库名。 +- tz: 可选参数,指定返回时间的时区,遵照 IANA Time Zone 规则,如 `America/New_York`。 例如:`http://h1.taos.com:6041/rest/sql/test` 是指向地址为 `h1.taos.com:6041` 的 URL,并将默认使用的数据库库名设置为 `test`。 @@ -99,13 +100,13 @@ HTTP 请求的 BODY 里就是一个完整的 SQL 语句,SQL 语句中的数据 使用 `curl` 通过自定义身份认证方式来发起一个 HTTP Request,语法如下: ```bash -curl -L -H "Authorization: Basic " -d "" :/rest/sql/[db_name] +curl -L -H "Authorization: Basic " -d "" :/rest/sql/[db_name][?tz=timezone] ``` 或者, ```bash -curl -L -u username:password -d "" :/rest/sql/[db_name] +curl -L -u username:password -d "" :/rest/sql/[db_name][?tz=timezone] ``` 其中,`TOKEN` 为 `{username}:{password}` 经过 Base64 编码之后的字符串,例如 `root:taosdata` 编码后为 `cm9vdDp0YW9zZGF0YQ==`。