userver: userver/http/http_version.hpp Source File
Loading...
Searching...
No Matches
http_version.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/http/http_version.hpp
4/// @brief @copybrief http::HttpVersion
5
6#include <string_view>
7
8#include <userver/yaml_config/fwd.hpp>
9
10USERVER_NAMESPACE_BEGIN
11
12namespace http {
13
14/// @brief HTTP version to use
15enum class HttpVersion {
16 kDefault, ///< unspecified version
17 k10, ///< HTTP/1.0 only
18 k11, ///< HTTP/1.1 only
19 k2, ///< HTTP/2 with fallback to HTTP/1.1
20 k2Tls, ///< HTTP/2 over TLS only, otherwise (no TLS or h2) HTTP/1.1
21 k2PriorKnowledge, ///< HTTP/2 only (without Upgrade)
22};
23
24std::string_view ToString(HttpVersion version);
25
26HttpVersion HttpVersionFromString(std::string_view version);
27
29
30} // namespace http
31
32USERVER_NAMESPACE_END