@@ -74,7 +74,7 @@ Below is a list of all ``http`` functions.
74
74
to be free, and close it, in order to avoid exceeding the ``max_connections `` cache size.
75
75
In the worst case, libcurl will create a new socket for every request,
76
76
even if all requests are going to the same host.
77
- See `this Tarantool issue on github <https://github.com/tarantool/tarantool/issues/3945 >`_
77
+ See `this Tarantool issue on Github <https://github.com/tarantool/tarantool/issues/3945 >`_
78
78
for details.
79
79
80
80
:return: a new HTTP client instance
@@ -104,43 +104,43 @@ Below is a list of all ``http`` functions.
104
104
:param table opts: table of connection options, with any of these
105
105
components:
106
106
107
- * ``ca_file `` - path to an SSL certificate file to verify the peer with
108
- * ``ca_path `` - path to a directory holding one or more certificates to
109
- verify the peer with
110
- * ``headers `` - table of HTTP headers
111
- * ``keepalive_idle `` - delay, in seconds, that the operating system
107
+ * ``ca_file `` -- path to an SSL certificate file to verify the peer with.
108
+ * ``ca_path `` -- path to a directory holding one or more certificates to
109
+ verify the peer with.
110
+ * ``headers `` -- table of HTTP headers.
111
+ * ``keepalive_idle `` -- delay, in seconds, that the operating system
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
115
and the note below about keepalive_interval.
116
- * ``keepalive_interval `` - the interval, in seconds, that the operating
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 ``
123
- * ``low_speed_limit `` - set the "low speed limit" -- the average
122
+ Otherwise Tarantool will send ``Connection:close ``.
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
126
126
too slow and abort. See also
127
- `CURLOPT_LOW_SPEED_LIMIT <https://curl.haxx.se/libcurl/c/CURLOPT_LOW_SPEED_LIMIT.html >`_
128
- * ``low_speed_time `` - set the "low speed time" -- the time that the
127
+ `CURLOPT_LOW_SPEED_LIMIT <https://curl.haxx.se/libcurl/c/CURLOPT_LOW_SPEED_LIMIT.html >`_.
128
+ * ``low_speed_time `` -- set the "low speed time" -- the time that the
129
129
transfer speed should be below the "low speed limit" for the library
130
130
to consider it too slow and abort. See also
131
- `CURLOPT_LOW_SPEED_TIME <https://curl.haxx.se/libcurl/c/CURLOPT_LOW_SPEED_TIME.html >`_
132
- * ``max_header_name_len `` - the maximal length of a header name. If a header
131
+ `CURLOPT_LOW_SPEED_TIME <https://curl.haxx.se/libcurl/c/CURLOPT_LOW_SPEED_TIME.html >`_.
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
134
The default value is '32'.
135
- * ``follow_location `` - when the option is set to ``true `` (default)
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 ``
138
138
header. If the new response is 3xx again, the HTTP client will
139
139
issue still another request and so on in a loop until a non-3xx response
140
140
will be received. This last response will be returned as a result.
141
141
Setting this option to ``false `` allows to disable this behavior.
142
142
In this case, the HTTP client will return a 3xx response itself.
143
- * ``no_proxy `` - a comma-separated list of hosts that do not require proxies, or '*', or ''.
143
+ * ``no_proxy `` -- a comma-separated list of hosts that do not require proxies, or '*', or ''.
144
144
Set :samp: `no_proxy = { host } [, { host } ...] ` to specify
145
145
hosts that can be reached without requiring a proxy, even if ``proxy `` has
146
146
been set to a non-blank value and/or if a proxy-related environment variable
@@ -152,44 +152,44 @@ Below is a list of all ``http`` functions.
152
152
(HTTP_PROXY) is used.
153
153
If ``no_proxy `` is not set, then a proxy-related environment variable
154
154
(HTTP_PROXY) may be used. See also
155
- `CURLOPT_NOPROXY <https://curl.haxx.se/libcurl/c/CURLOPT_NOPROXY.html >`_
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
- If ``proxy `` is set to '' an empty string, then proxy use is disabled,
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
162
HTTP_PROXY or HTTPS_PROXY or FTP_PROXY, or ALL_PROXY if the
163
163
protocol can be any protocol. See also
164
- `CURLOPT_PROXY <https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html >`_
164
+ `CURLOPT_PROXY <https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html >`_.
165
165
* ``proxy_port `` -- a proxy server port.
166
166
The default is 443 for an https proxy and 1080 for a non-https proxy.
167
167
See also
168
- `CURLOPT_PROXYPORT <https://curl.haxx.se/libcurl/c/CURLOPT_PROXYPORT.html >`_
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.
170
170
Format: :samp: `proxy_user_pwd = { user_name } : `
171
171
or :samp: `proxy_user_pwd = :{ password } `
172
172
or :samp: `proxy_user_pwd = { user_name } :{ password } `. See also
173
- `CURLOPT_USERPWD <https://curl.haxx.se/libcurl/c/CURLOPT_USERPWD.html >`_
174
- * ``ssl_cert `` - path to a SSL client certificate file. See also
175
- `CURLOPT_SSLCERT <https://curl.haxx.se/libcurl/c/CURLOPT_SSLCERT.html >`_
176
- * ``ssl_key `` - path to a private key file for a TLS and SSL client
173
+ `CURLOPT_USERPWD <https://curl.haxx.se/libcurl/c/CURLOPT_USERPWD.html >`_.
174
+ * ``ssl_cert `` -- path to a SSL client certificate file. See also
175
+ `CURLOPT_SSLCERT <https://curl.haxx.se/libcurl/c/CURLOPT_SSLCERT.html >`_.
176
+ * ``ssl_key `` -- path to a private key file for a TLS and SSL client
177
177
certificate. See also
178
- `CURLOPT_SSLKEY <https://curl.haxx.se/libcurl/c/CURLOPT_SSLKEY.html >`_
179
- * ``timeout `` - number of seconds to wait for a curl API read request
180
- before timing out
181
- * ``unix_socket `` - a socket name to use instead of an Internet address,
178
+ `CURLOPT_SSLKEY <https://curl.haxx.se/libcurl/c/CURLOPT_SSLKEY.html >`_.
179
+ * ``timeout `` -- number of seconds to wait for a curl API read request
180
+ before timing out. The default timeout is set to infinity (36586400100 seconds).
181
+ * ``unix_socket `` -- a socket name to use instead of an Internet address,
182
182
for a local connection. The Tarantool server must be built with
183
183
``libcurl `` 7.40 or later. See the :ref: `second example <http-example2 >`
184
184
later in this section.
185
- * ``verbose `` - set on/off verbose mode
186
- * ``verify_host `` - set on/off verification of the certificate's name
185
+ * ``verbose `` -- set on/off verbose mode.
186
+ * ``verify_host `` -- set on/off verification of the certificate's name
187
187
(CN) against host. See also
188
- `CURLOPT_SSL_VERIFYHOST <https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html >`_
189
- * ``verify_peer `` - set on/off verification of the peer's SSL
188
+ `CURLOPT_SSL_VERIFYHOST <https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html >`_.
189
+ * ``verify_peer `` -- set on/off verification of the peer's SSL
190
190
certificate. See also
191
- `CURLOPT_SSL_VERIFYPEER <https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html >`_
192
- * ``accept_encoding `` - enables automatic decompression of HTTP responses
191
+ `CURLOPT_SSL_VERIFYPEER <https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html >`_.
192
+ * ``accept_encoding `` -- enables automatic decompression of HTTP responses
193
193
by setting the contents of the `Accept-Encoding: header ` sent in an
194
194
HTTP request and enabling decoding of a response when the `Content-Encoding: header `
195
195
is received. This option specifies what encoding to use.
@@ -199,15 +199,15 @@ Below is a list of all ``http`` functions.
199
199
response using the zlib algorithm, `gzip ` which requests the gzip algorithm and `br `
200
200
which is brotli. Provide them in the string as a comma-separated list of accepted
201
201
encodings, like: ``"br, gzip, deflate" ``.
202
- For details of the option, refer to `CURLOPT_ACCEPT_ENCODING <https://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html >`_
202
+ For details of the option, refer to `CURLOPT_ACCEPT_ENCODING <https://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html >`_.
203
203
204
204
:return: connection information, with all of these components:
205
205
206
- * ``status `` - HTTP response status
207
- * ``reason `` - HTTP response status text
208
- * ``headers `` - a Lua table with normalized HTTP headers
209
- * ``body `` - response body
210
- * ``proto `` - protocol version
206
+ * ``status `` -- HTTP response status
207
+ * ``reason `` -- HTTP response status text
208
+ * ``headers `` -- a Lua table with normalized HTTP headers
209
+ * ``body `` -- response body
210
+ * ``proto `` -- protocol version
211
211
212
212
:rtype: table
213
213
@@ -256,23 +256,23 @@ Below is a list of all ``http`` functions.
256
256
257
257
The following "shortcuts" exist for requests:
258
258
259
- * ``http_client:get(url, options) `` - shortcut for
259
+ * ``http_client:get(url, options) `` -- shortcut for
260
260
``http_client:request("GET", url, nil, opts) ``
261
- * ``http_client:post (url, body, options) `` - shortcut for
261
+ * ``http_client:post (url, body, options) `` -- shortcut for
262
262
``http_client:request("POST", url, body, opts) ``
263
- * ``http_client:put(url, body, options) `` - shortcut for
263
+ * ``http_client:put(url, body, options) `` -- shortcut for
264
264
``http_client:request("PUT", url, body, opts) ``
265
- * ``http_client:patch(url, body, options) `` - shortcut for
265
+ * ``http_client:patch(url, body, options) `` -- shortcut for
266
266
``http_client:request("PATCH", url, body, opts) ``
267
- * ``http_client:options(url, options) `` - shortcut for
267
+ * ``http_client:options(url, options) `` -- shortcut for
268
268
``http_client:request("OPTIONS", url, nil, opts) ``
269
- * ``http_client:head(url, options) `` - shortcut for
269
+ * ``http_client:head(url, options) `` -- shortcut for
270
270
``http_client:request("HEAD", url, nil, opts) ``
271
- * ``http_client:delete(url, options) `` - shortcut for
271
+ * ``http_client:delete(url, options) `` -- shortcut for
272
272
``http_client:request("DELETE", url, nil, opts) ``
273
- * ``http_client:trace(url, options) `` - shortcut for
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
@@ -288,15 +288,15 @@ Below is a list of all ``http`` functions.
288
288
289
289
The ``http_client:stat() `` function returns a table with statistics:
290
290
291
- * ``active_requests `` - number of currently executing requests
292
- * ``sockets_added `` - total number of sockets added into an event loop
293
- * ``sockets_deleted `` - total number of sockets sockets from an event loop
294
- * ``total_requests `` - total number of requests
295
- * ``http_200_responses `` - total number of requests which have returned
291
+ * ``active_requests `` -- number of currently executing requests
292
+ * ``sockets_added `` -- total number of sockets added into an event loop
293
+ * ``sockets_deleted `` -- total number of sockets sockets from an event loop
294
+ * ``total_requests `` -- total number of requests
295
+ * ``http_200_responses `` -- total number of requests which have returned
296
296
code HTTP 200
297
- * ``http_other_responses `` - total number of requests which have not
297
+ * ``http_other_responses `` -- total number of requests which have not
298
298
returned code HTTP 200
299
- * ``failed_requests `` - total number of requests which have failed
299
+ * ``failed_requests `` -- total number of requests which have failed
300
300
including system errors, curl errors, and HTTP errors
301
301
302
302
.. _http-example1 :
0 commit comments