From d8afc56ef5139fde7b4a2b9e4d6a54c445dd7acd Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Fri, 18 Oct 2024 22:55:04 +0200 Subject: [PATCH 1/2] Update README.md --- docs/README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 120470e..61c9e68 100644 --- a/docs/README.md +++ b/docs/README.md @@ -61,10 +61,33 @@ SELECT httpserve_start('localhost', 9999, 'supersecretkey'); │ HTTP server started on 0.0.0.0:9999 │ └───────────────────────────────────────────────┘ ``` -``` + +Query your endpoint using the `X-API-Key` token: + +```bash curl -X POST --header "X-API-Key: secretkey" -d "SELECT 'hello', version()" "http://localhost:9999/" ``` +You can perform the same action from DuckDB using HTTP SECRE headers: + +```sql +D CREATE SECRET extra_http_headers ( + TYPE HTTP, + EXTRA_HTTP_HEADERS MAP{ + 'X-API-Key': 'secret' + } + ); + +D SELECT * FROM duck_flock('SELECT version()', ['http://localhost:9999']); +┌─────────────┐ +│ "version"() │ +│ varchar │ +├─────────────┤ +│ v1.1.1 │ +└─────────────┘ +``` + + #### 👉 QUERY UI Browse to your endpoint and use the built-in quackplay interface _(experimental)_ From 99b74d18baaf28aa7f651e2be7b2dd3cf04e0e39 Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Fri, 18 Oct 2024 22:55:39 +0200 Subject: [PATCH 2/2] Update README.md --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 61c9e68..38b9918 100644 --- a/docs/README.md +++ b/docs/README.md @@ -68,7 +68,7 @@ Query your endpoint using the `X-API-Key` token: curl -X POST --header "X-API-Key: secretkey" -d "SELECT 'hello', version()" "http://localhost:9999/" ``` -You can perform the same action from DuckDB using HTTP SECRE headers: +You can perform the same action from DuckDB using HTTP `extra_http_headers`: ```sql D CREATE SECRET extra_http_headers (