Skip to content

Commit 4aac72c

Browse files
TheOtherBrian1steve-chavez
authored andcommitted
Added net.http_delete and removed timeout warning comments from the API docs
Added net.http_delete function to the API docs and removed comments about ignored timeout parameters in request functions, as the issue has been resolved.
1 parent 50eb876 commit 4aac72c

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

docs/api.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ net.http_get(
2020
params jsonb default '{}'::jsonb,
2121
-- key/values to be included in request headers
2222
headers jsonb default '{}'::jsonb,
23-
-- WARNING: this is currently ignored, so there is no timeout
2423
-- the maximum number of milliseconds the request may take before being cancelled
2524
timeout_milliseconds int default 1000
2625
)
@@ -67,7 +66,6 @@ net.http_post(
6766
params jsonb default '{}'::jsonb,
6867
-- key/values to be included in request headers
6968
headers jsonb default '{"Content-Type": "application/json"}'::jsonb,
70-
-- WARNING: this is currently ignored, so there is no timeout
7169
-- the maximum number of milliseconds the request may take before being cancelled
7270
timeout_milliseconds int default 1000
7371
)
@@ -91,3 +89,52 @@ request_id
9189
1
9290
(1 row)
9391
```
92+
93+
### net.http_delete
94+
95+
##### description
96+
Create an HTTP DELETE request, returning the request's id
97+
98+
!!! note
99+
HTTP requests are not started until the transaction is committed
100+
101+
!!! note
102+
the body's character set encoding matches the database's `server_encoding` setting
103+
104+
!!! note
105+
this is a Postgres SECURITY DEFINER function
106+
107+
##### signature
108+
109+
```sql
110+
net.http_delete(
111+
-- url for the request
112+
url text,
113+
-- key/value pairs to be url encoded and appended to the `url`
114+
params jsonb default '{}'::jsonb,
115+
-- key/values to be included in request headers
116+
headers jsonb default '{}'::jsonb,
117+
-- the maximum number of milliseconds the request may take before being cancelled
118+
timeout_milliseconds int default 2000
119+
)
120+
-- request_id reference
121+
returns bigint
122+
123+
strict
124+
volatile
125+
parallel safe
126+
language plpgsql
127+
security definer
128+
```
129+
130+
##### usage
131+
```sql
132+
select
133+
net.http_delete(
134+
url:='https://dummy.restapiexample.com/api/v1/delete/2'
135+
) as request_id;
136+
request_id
137+
----------
138+
1
139+
(1 row)
140+
```

0 commit comments

Comments
 (0)