Skip to content

Commit de723f3

Browse files
authored
Merge branch 'main' into thread-options
2 parents d6e0d88 + 99b74d1 commit de723f3

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

docs/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,33 @@ SELECT httpserve_start('localhost', 9999, 'supersecretkey');
6262
│ HTTP server started on 0.0.0.0:9999
6363
└───────────────────────────────────────────────┘
6464
```
65-
```
65+
66+
Query your endpoint using the `X-API-Key` token:
67+
68+
```bash
6669
curl -X POST --header "X-API-Key: secretkey" -d "SELECT 'hello', version()" "http://localhost:9999/"
6770
```
6871

72+
You can perform the same action from DuckDB using HTTP `extra_http_headers`:
73+
74+
```sql
75+
D CREATE SECRET extra_http_headers (
76+
TYPE HTTP,
77+
EXTRA_HTTP_HEADERS MAP{
78+
'X-API-Key': 'secret'
79+
}
80+
);
81+
82+
D SELECT * FROM duck_flock('SELECT version()', ['http://localhost:9999']);
83+
┌─────────────┐
84+
"version"() │
85+
varchar
86+
├─────────────┤
87+
v1.1.1
88+
└─────────────┘
89+
```
90+
91+
6992

7093
#### 👉 QUERY UI
7194
Browse to your endpoint and use the built-in quackplay interface _(experimental)_

0 commit comments

Comments
 (0)