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.
Showing
- changelogs/unreleased/gh-9806-http-set-version.md 4 additions, 0 deletionschangelogs/unreleased/gh-9806-http-set-version.md
- src/httpc.c 23 additions, 0 deletionssrc/httpc.c
- src/httpc.h 10 additions, 0 deletionssrc/httpc.h
- src/lua/httpc.c 9 additions, 0 deletionssrc/lua/httpc.c
- src/lua/httpc.lua 2 additions, 0 deletionssrc/lua/httpc.lua
- test/app-luatest/http_client_http_version_test.lua 94 additions, 0 deletionstest/app-luatest/http_client_http_version_test.lua
Loading
Please register or sign in to comment