Skip to content

Commit d8afc56

Browse files
authored
Update README.md
1 parent b405202 commit d8afc56

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
@@ -61,10 +61,33 @@ SELECT httpserve_start('localhost', 9999, 'supersecretkey');
6161
│ HTTP server started on 0.0.0.0:9999
6262
└───────────────────────────────────────────────┘
6363
```
64-
```
64+
65+
Query your endpoint using the `X-API-Key` token:
66+
67+
```bash
6568
curl -X POST --header "X-API-Key: secretkey" -d "SELECT 'hello', version()" "http://localhost:9999/"
6669
```
6770

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

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

0 commit comments

Comments
 (0)