forked from ehmicky/Notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpgsql_http.postgres.txt
More file actions
49 lines (40 loc) · 2.06 KB
/
pgsql_http.postgres.txt
File metadata and controls
49 lines (40 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
┏━━━━━━━━━━━━━━━━┓
┃ PGSQL_HTTP ┃
┗━━━━━━━━━━━━━━━━┛
ALTERNATIVES ==> # - pgsql-http: sync, more features
# - pg_net: async
VERSION ==> #1.6.3
#Postgres EXTENSION to send HTTP requests using `curl`
http(REQ)->RES #
http_get('URI'[, JSONB])->RES #
http_head('URI')->RES #
http_post|put|patch|delete
('URI', 'BODY', 'MIME')->RES #
http_post('URI', JSONB)->RES #
http_request #TYPE
REQ.method #STR
REQ.uri #'URL'
REQ.headers #HEADER_ARR
REQ.content_type #'MIME'
REQ.content #STR
http_header('VAR', 'VAL')->HEADER
http_header #TYPE
HEADER.field #'VAR'
HEADER.value #'VAL'
http_response #TYPE
RES.status #INT4
RES.headers #HEADER_ARR
RES.content_type #'MIME'
RES.content #STR
http_set_curlopt('OPT', 'VAL') #Sets curl options among:
->BOOL # - useragent
# - timeout[_ms]
# - connecttimeout[_ms]
# - tcp_keepalive, tcp_keepidle
# - tlsauth_*, ssl_verifyhost, ssl_verifypeer, sslcert[_blob], sslkey[_blob], sslcerttype, cainfo
# - [pre_]proxy, proxyport, proxyuserpwd, proxyusername, proxypassword, proxy_tlsauth_*
# - dns_servers
#All uppercase, starting with CURLOPT_*
http_reset_curlopt()->BOOL
http_list_curlopt()->ROW_SET #ROW: curlopt 'VAR', value 'VAL'
urlencode(STR|JSONB)->STR #