Skip to main content
Skip to main content

HTTP(S) dictionary source

Working with an HTTP(S) server depends on how the dictionary is stored in memory. If the dictionary is stored using cache and complex_key_cache, ClickHouse requests the necessary keys by sending a request via the POST method.

Example of settings:

SOURCE(HTTP(
    url 'http://[::1]/os.tsv'
    format 'TabSeparated'
    credentials(user 'user' password 'password')
    headers(header(name 'API-KEY' value 'key'))
))

In order for ClickHouse to access an HTTPS resource, you must configure openSSL in the server configuration.

Setting fields:

SettingDescription
urlThe source URL.
formatThe file format. All the formats described in Formats are supported.
credentialsBasic HTTP authentication. Optional.
userUsername required for the authentication.
passwordPassword required for the authentication.
headersAll custom HTTP headers entries used for the HTTP request. Optional.
headerSingle HTTP header entry.
nameIdentifier name used for the header send on the request.
valueValue set for a specific identifier name.

When creating a dictionary using the DDL command (CREATE DICTIONARY ...) remote hosts for HTTP dictionaries are checked against the contents of remote_url_allow_hosts section from config to prevent database users to access arbitrary HTTP server.