From cf9a636100fbaf79687c268ce709c3f30292fdb8 Mon Sep 17 00:00:00 2001 From: Sergei Bocharov Date: Wed, 27 Nov 2019 14:56:24 +0300 Subject: [PATCH 1/3] Docs: Added Content-Type Header --- docs/en/interfaces/http.md | 13 ++++++++++++- docs/ru/interfaces/http.md | 12 +++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/en/interfaces/http.md b/docs/en/interfaces/http.md index ee05a1cdb64..2423cd20a71 100644 --- a/docs/en/interfaces/http.md +++ b/docs/en/interfaces/http.md @@ -28,8 +28,12 @@ $ wget -O- -q 'http://localhost:8123/?query=SELECT 1' $ echo -ne 'GET /?query=SELECT%201 HTTP/1.0\r\n\r\n' | nc localhost 8123 HTTP/1.0 200 OK +Date: Wed, 27 Nov 2019 10:30:18 GMT Connection: Close -Date: Fri, 16 Nov 2012 19:21:50 GMT +Content-Type: text/tab-separated-values; charset=UTF-8 +X-ClickHouse-Server-Display-Name: clickhouse.ru-central1.internal +X-ClickHouse-Query-Id: 5abe861c-239c-467f-b955-8a201abb8b7f +X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0"} 1 ``` @@ -84,6 +88,13 @@ Using the familiar INSERT query for data insertion: $ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @- ``` +You can add [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5) header using the `-H` flag: + +```bash +$ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @- -H 'Content-Type: text/plain;charset=UTF-8' +``` + + Data can be sent separately from the query: ```bash diff --git a/docs/ru/interfaces/http.md b/docs/ru/interfaces/http.md index c7c32a46a4c..b92ac975790 100644 --- a/docs/ru/interfaces/http.md +++ b/docs/ru/interfaces/http.md @@ -28,8 +28,12 @@ $ wget -O- -q 'http://localhost:8123/?query=SELECT 1' $ echo -ne 'GET /?query=SELECT%201 HTTP/1.0\r\n\r\n' | nc localhost 8123 HTTP/1.0 200 OK +Date: Wed, 27 Nov 2019 10:30:18 GMT Connection: Close -Date: Fri, 16 Nov 2012 19:21:50 GMT +Content-Type: text/tab-separated-values; charset=UTF-8 +X-ClickHouse-Server-Display-Name: clickhouse.ru-central1.internal +X-ClickHouse-Query-Id: 5abe861c-239c-467f-b955-8a201abb8b7f +X-ClickHouse-Summary: {"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0"} 1 ``` @@ -85,6 +89,12 @@ $ echo 'CREATE TABLE t (a UInt8) ENGINE = Memory' | curl 'http://localhost:8123/ $ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @- ``` +К запросу можно добавить заголовок [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5) с помощью флага `-H`: + +```bash +$ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @- -H 'Content-Type: text/plain;charset=UTF-8' +``` + Данные можно отправить отдельно от запроса: ```bash From edbe6c7638364dbc7b35b1e8e111772e069d9508 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 3 Dec 2019 04:06:53 +0300 Subject: [PATCH 2/3] Update http.md --- docs/en/interfaces/http.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/en/interfaces/http.md b/docs/en/interfaces/http.md index 2423cd20a71..25a146f78b3 100644 --- a/docs/en/interfaces/http.md +++ b/docs/en/interfaces/http.md @@ -88,13 +88,6 @@ Using the familiar INSERT query for data insertion: $ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @- ``` -You can add [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5) header using the `-H` flag: - -```bash -$ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @- -H 'Content-Type: text/plain;charset=UTF-8' -``` - - Data can be sent separately from the query: ```bash From 8e22057adf00b5ac0374e34a7399c12c5efbada0 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 3 Dec 2019 04:07:14 +0300 Subject: [PATCH 3/3] Update http.md --- docs/ru/interfaces/http.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/ru/interfaces/http.md b/docs/ru/interfaces/http.md index b92ac975790..4da101796f1 100644 --- a/docs/ru/interfaces/http.md +++ b/docs/ru/interfaces/http.md @@ -89,12 +89,6 @@ $ echo 'CREATE TABLE t (a UInt8) ENGINE = Memory' | curl 'http://localhost:8123/ $ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @- ``` -К запросу можно добавить заголовок [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5) с помощью флага `-H`: - -```bash -$ echo 'INSERT INTO t VALUES (1),(2),(3)' | curl 'http://localhost:8123/' --data-binary @- -H 'Content-Type: text/plain;charset=UTF-8' -``` - Данные можно отправить отдельно от запроса: ```bash