Get HTTP connection settings
Gets the settings structure for HTTP connection
- Parameters
- Advanced call ?
Function GetHTTPConnectionSettings(Val Address, Val Authorization = Undefined, Val AdditionalHeaders = Undefined) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Address | --url | String | ✔ | Connection address with protocol and port |
| Authorization | --auth | String, Structure Of KeyAndValue | ✖ | Authorization: string for JWT, structure for basic |
| AdditionalHeaders | --headers | Map Of KeyAndValue | ✖ | Additional request headers |
Returns
Structure Of KeyAndValue - Connection settings structure
| Parameter | Description |
|---|---|
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
URL = "http://localhost:8123";
// No authorization
Result = OPI_ClickHouse.GetHTTPConnectionSettings(URL);
// With basic authorization
Login = "bayselonarrend";
Password = "12we...";
Authorization = New Structure(Login, Password);
Result = OPI_ClickHouse.GetHTTPConnectionSettings(URL, Authorization);
// With JWT authorization
JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test";
Result = OPI_ClickHouse.GetHTTPConnectionSettings(URL, JWT);
// With additional headers
AdditionalHeaders = New Map;
AdditionalHeaders.Insert("X-Custom-Header", "CustomValue");
Result = OPI_ClickHouse.GetHTTPConnectionSettings(URL, Authorization, AdditionalHeaders);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint clickhouse GetHTTPConnectionSettings \
--url "http://127.0.0.1:8123" \
--auth "{'bayselonarrend':'***'}" \
--headers "{'X-Custom-Header':'CustomValue'}"
:: JSON data can also be passed as a path to a .json file
oint clickhouse GetHTTPConnectionSettings ^
--url "http://127.0.0.1:8123" ^
--auth "{'bayselonarrend':'***'}" ^
--headers "{'X-Custom-Header':'CustomValue'}"
Result
{
"address": "http://host.docker.internal:8123",
"headers": {
"X-Custom-Header": "CustomValue"
},
"transport": "http",
"auth_type": "basic",
"user": "bayselonarrend",
"password": "***"
}