1
- .. _http-module :
1
+ .. _http-module :
2
2
3
3
-------------------------------------------------------------------------------
4
4
Module http
5
5
-------------------------------------------------------------------------------
6
6
7
- .. module :: http.client
7
+ .. module :: http.client
8
8
9
9
===============================================================================
10
10
Overview
@@ -20,10 +20,10 @@ It uses routines in the `libcurl <https://curl.haxx.se/libcurl/>`_ library.
20
20
21
21
Below is a list of all ``http `` functions.
22
22
23
- .. container :: table
23
+ .. container :: table
24
24
25
- .. rst-class :: left-align-column-1
26
- .. rst-class :: left-align-column-2
25
+ .. rst-class :: left-align-column-1
26
+ .. rst-class :: left-align-column-2
27
27
28
28
+--------------------------------------+---------------------------------+
29
29
| Name | Use |
@@ -38,9 +38,9 @@ Below is a list of all ``http`` functions.
38
38
| <client_object-stat>` | |
39
39
+--------------------------------------+---------------------------------+
40
40
41
- .. _http-new :
41
+ .. _http-new :
42
42
43
- .. function :: new([options])
43
+ .. function :: new([options])
44
44
45
45
Construct a new HTTP client instance.
46
46
@@ -55,7 +55,7 @@ Below is a list of all ``http`` functions.
55
55
``max_total_connections `` is the maximum number of active connections.
56
56
It affects libcurl `CURLMOPT_MAX_TOTAL_CONNECTIONS <https://curl.haxx.se/libcurl/c/CURLMOPT_MAX_TOTAL_CONNECTIONS.html >`_.
57
57
It is ignored if the curl version is less than 7.30.
58
- The default is 0 , which allows libcurl to scale accordingly to easily handles count.
58
+ The default is `` 0 `` , which allows libcurl to scale accordingly to easily handles count.
59
59
60
60
The default option values are usually good enough but in rare cases it
61
61
might be good to set them. In that case here are two tips.
@@ -82,17 +82,17 @@ Below is a list of all ``http`` functions.
82
82
83
83
**Example: **
84
84
85
- .. code-block :: tarantoolsession
85
+ .. code-block :: tarantoolsession
86
86
87
87
tarantool> http_client = require('http.client').new({max_connections = 5})
88
88
---
89
89
...
90
90
91
- .. class :: client_object
91
+ .. class :: client_object
92
92
93
- .. _client_object-request :
93
+ .. _client_object-request :
94
94
95
- .. method :: request(method, url, body, opts)
95
+ .. method :: request(method, url, body, opts)
96
96
97
97
If ``http_client `` is an HTTP client instance, ``http_client:request() `` will
98
98
perform an HTTP request and, if there is a successful connection,
@@ -112,14 +112,14 @@ Below is a list of all ``http`` functions.
112
112
will wait while the connection is idle before sending keepalive
113
113
probes. See also
114
114
`CURLOPT_TCP_KEEPIDLE <https://curl.haxx.se/libcurl/c/CURLOPT_TCP_KEEPIDLE.html >`_
115
- and the note below about keepalive_interval.
115
+ and the note below about `` keepalive_interval `` .
116
116
* ``keepalive_interval `` -- the interval, in seconds, that the operating
117
117
system will wait between sending keepalive probes. See also
118
118
`CURLOPT_TCP_KEEPINTVL <https://curl.haxx.se/libcurl/c/CURLOPT_TCP_KEEPINTVL.html >`_.
119
119
If both ``keepalive_idle `` and ``keepalive_interval `` are set, then
120
120
Tarantool will also set HTTP keepalive headers: ``Connection:Keep-Alive ``
121
121
and ``Keep-Alive:timeout=<keepalive_idle> ``.
122
- Otherwise Tarantool will send ``Connection:close ``.
122
+ Otherwise, Tarantool will send ``Connection:close ``.
123
123
* ``low_speed_limit `` -- set the "low speed limit" -- the average
124
124
transfer speed in bytes per second that the transfer should be below
125
125
during "low speed time" seconds for the library to consider it to be
@@ -131,7 +131,7 @@ Below is a list of all ``http`` functions.
131
131
`CURLOPT_LOW_SPEED_TIME <https://curl.haxx.se/libcurl/c/CURLOPT_LOW_SPEED_TIME.html >`_.
132
132
* ``max_header_name_len `` -- the maximal length of a header name. If a header
133
133
name is bigger than this value, it is truncated to this length.
134
- The default value is '32' .
134
+ The default value is `` 32 `` .
135
135
* ``follow_location `` -- when the option is set to ``true `` (default)
136
136
and the response has a 3xx code, the HTTP client will automatically issue
137
137
another request to a location that a server sends in the ``Location ``
@@ -149,21 +149,21 @@ Below is a list of all ``http`` functions.
149
149
without requiring a proxy, which is equivalent to setting ``proxy='' ``.
150
150
Set ``no_proxy = '' `` to specify that no hosts can be reached
151
151
without requiring a proxy, even if a proxy-related environment variable
152
- (HTTP_PROXY) is used.
152
+ (`` HTTP_PROXY `` ) is used.
153
153
If ``no_proxy `` is not set, then a proxy-related environment variable
154
- (HTTP_PROXY) may be used. See also
154
+ (`` HTTP_PROXY `` ) may be used. See also
155
155
`CURLOPT_NOPROXY <https://curl.haxx.se/libcurl/c/CURLOPT_NOPROXY.html >`_.
156
156
* ``proxy `` - a proxy server host or IP address, or ''.
157
157
If ``proxy `` is a host or IP address, then it may begin with a scheme,
158
158
for example ``https:// `` for an https proxy or ``http:// `` for an http proxy.
159
159
If ``proxy `` is set to '' -- an empty string, then proxy use is disabled,
160
160
and no proxy-related environment variable will be used.
161
161
If ``proxy `` is not set, then a proxy-related environment variable may be used, such as
162
- HTTP_PROXY or HTTPS_PROXY or FTP_PROXY, or ALL_PROXY if the
162
+ `` HTTP_PROXY `` or `` HTTPS_PROXY `` or `` FTP_PROXY `` , or `` ALL_PROXY `` if the
163
163
protocol can be any protocol. See also
164
164
`CURLOPT_PROXY <https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html >`_.
165
165
* ``proxy_port `` -- a proxy server port.
166
- The default is 443 for an https proxy and 1080 for a non-https proxy.
166
+ The default is `` 443 `` for an https proxy and `` 1080 `` for a non-https proxy.
167
167
See also
168
168
`CURLOPT_PROXYPORT <https://curl.haxx.se/libcurl/c/CURLOPT_PROXYPORT.html >`_.
169
169
* ``proxy_user_pwd `` -- a proxy server user name and/or password.
@@ -272,7 +272,7 @@ Below is a list of all ``http`` functions.
272
272
``http_client:request("DELETE", url, nil, opts) ``
273
273
* ``http_client:trace(url, options) `` -- shortcut for
274
274
``http_client:request("TRACE", url, nil, opts) ``
275
- * ``http_client:connect: (url, options) `` -- shortcut for
275
+ * ``http_client:connect(url, options) `` -- shortcut for
276
276
``http_client:request("CONNECT", url, nil, opts) ``
277
277
278
278
Requests may be influenced by environment variables, for example
0 commit comments