diff --git a/expected/http.out b/expected/http.out index 555bf3b..53f1a22 100644 --- a/expected/http.out +++ b/expected/http.out @@ -175,3 +175,17 @@ SELECT status FROM http_get('http://httpbin.org/status/555'); 555 (1 row) +-- Alter the default timeout and then run a query that is longer than +-- the default (5s), but shorter than the new timeout +SELECT http_set_curlopt('CURLOPT_TIMEOUT_MS', '10000'); + http_set_curlopt +------------------ + t +(1 row) + +SELECT status FROM http_get('http://httpstat.us/200?sleep=7000'); + status +-------- + 200 +(1 row) + diff --git a/sql/http.sql b/sql/http.sql index 0174422..577a2b8 100644 --- a/sql/http.sql +++ b/sql/http.sql @@ -100,3 +100,7 @@ SELECT http_reset_curlopt(); -- Now it should work SELECT status FROM http_get('http://httpbin.org/status/555'); +-- Alter the default timeout and then run a query that is longer than +-- the default (5s), but shorter than the new timeout +SELECT http_set_curlopt('CURLOPT_TIMEOUT_MS', '10000'); +SELECT status FROM http_get('http://httpstat.us/200?sleep=7000');