Skip to content

Commit 037b60c

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents b105508 + 1852794 commit 037b60c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

docs/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ This very experimental extension spawns an HTTP Client from within DuckDB resolv
55

66
> Experimental: USE AT YOUR OWN RISK!
77
8-
### GET
8+
### Functions
9+
- `http_get(url)`
10+
- `http_post(url, headers, params)`
11+
12+
#### GET
913
```sql
1014
D SET autoinstall_known_extensions=1; SET autoload_known_extensions=1;
1115
D WITH __input AS (
@@ -53,7 +57,7 @@ D WITH __input AS (
5357
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
5458
```
5559

56-
### POST (WIP)
60+
#### POST (WIP)
5761
```sql
5862
D SELECT
5963
http_post(
@@ -68,3 +72,7 @@ D SELECT
6872
AS data;
6973
```
7074

75+
76+
#### Acknowledgements
77+
78+
Implementation inspired by [https://github.com/duckdb/duckdb/pull/11548] PR by @ahuarte47

src/http_client_extension.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static void HTTPGetRequestFunction(DataChunk &args, ExpressionState &state, Vect
4242
duckdb_httplib_openssl::Client client(domain.c_str());
4343
client.set_read_timeout(10, 0); // 10 seconds
4444

45-
// Follow redirects, limit to 10 by default
45+
// Follow redirects
4646
client.set_follow_location(true);
4747

4848
// Make the GET request
@@ -134,6 +134,8 @@ static void HTTPPostRequestFunction(DataChunk &args, ExpressionState &state, Vec
134134
// Create the client and set a timeout
135135
duckdb_httplib_openssl::Client client(domain.c_str());
136136
client.set_read_timeout(10, 0); // 10 seconds
137+
// Follow redirects
138+
client.set_follow_location(true);
137139

138140
// Follow redirects for POST as well
139141
client.set_follow_location(true);

0 commit comments

Comments
 (0)