Skip to content
Snippets Groups Projects
Commit c3695de1 authored by Col-Waltz's avatar Col-Waltz Committed by Alexander Turenko
Browse files

httpc: adding a new option in HTTP client

New option named http_version allows to set http version for each request.

Closes #9806

@TarantoolBot document
Title: `http_version` option for a set of functions in
`http.client` module.

The `http_version` option allows to set version of http in functions like
`request()`, `post()`, `get()` and etc using this curl option:
https://curl.se/libcurl/c/CURLOPT_HTTP_VERSION.html
The http_version takes one of the strings listed below or a nil value
and sets the appropriate protocol version.

List of supported values:
1) nil - works as '2-tls' by default.
2) '1.1' - sets HTTP/1.1 version.
3) '2' - sets HTTP/2 version that falls back to HTTP/1.1 if cannot be
   negotiated with the server.
4) '2-tls' - works as '2' for HTTPS and as '1.1' for plain text HTTP.
5) '2-prior-knowledge' sets HTTP/2 version without HTTP/1.1 at back.
   It requires prior knowledge that the server supports HTTP/2.
parent 7410a4f0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment