Thoth
A functional, expressive, asynchronous C++26 webdev library
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
RequestHeaders.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
Thoth/Http/NHeaders/Headers.hpp
>
3
4
#include <
Thoth/Http/NHeaders/Request/Headers/_pch.hpp
>
5
#include <
Thoth/Http/NHeaders/Headers/EntityTag.hpp
>
6
7
namespace
Thoth::Http
{
8
// based in Microslop's HttpRequestHeaders
9
12
struct
RequestHeaders
:
Headers
{
13
14
#pragma region Raw and Collection Views
18
21
[[nodiscard]] [[nodiscard]]
auto
GetNonValidatedView
()
const
;
22
25
[[nodiscard]] [[nodiscard]]
auto
GetCookiesView
()
const
;
26
28
#pragma endregion
29
30
31
32
#pragma region Request Specific Proxies
36
37
// TODO: Implement (someday)
38
// ! @brief Gets the Authorization header (e.g., Bearer, Basic).
39
NHeaders::ValueProxy<false, std::string>
Authorization
();
40
[[nodiscard]]
NHeaders::ValueProxy<true, std::string>
Authorization
()
const
;
41
42
using
Url
=
string
;
43
45
NHeaders::ValueProxy<false, Url>
Host
();
46
[[nodiscard]]
NHeaders::ValueProxy<true, Url>
Host
()
const
;
47
49
NHeaders::ValueProxy<false, Url>
Referrer
();
50
[[nodiscard]]
NHeaders::ValueProxy<true, Url>
Referrer
()
const
;
51
53
NHeaders::ValueProxy<false, Url, std::monostate>
Origin
();
54
[[nodiscard]]
NHeaders::ValueProxy<true, Url, std::monostate>
Origin
()
const
;
55
57
NHeaders::ValueProxy<false, string>
From
();
58
[[nodiscard]]
NHeaders::ValueProxy<true, string>
From
()
const
;
59
61
NHeaders::ValueProxy<false, unsigned int>
MaxForwards
();
62
[[nodiscard]]
NHeaders::ValueProxy<true, unsigned int>
MaxForwards
()
const
;
63
65
//void GetProtocol();
66
//[[nodiscard]] void GetProtocol() const;
67
69
NHeaders::ValueProxy<false, string>
ProxyAuthorization
();
70
[[nodiscard]]
NHeaders::ValueProxy<true, string>
ProxyAuthorization
()
const
;
71
73
NHeaders::ListProxy<false, NHeaders::Range>
Range
();
74
[[nodiscard]]
NHeaders::ListProxy<true, NHeaders::Range>
Range
()
const
;
75
76
// //! @brief The value of the Cache-Control header for the request.
77
// NHeaders::ValueProxy<false, string> CacheControl();
78
// [[nodiscard]] NHeaders::ValueProxy<true, string> CacheControl() const;
79
81
NHeaders::ValueProxy<false, std::chrono::utc_clock::time_point>
IfModifiedSince
();
82
[[nodiscard]]
NHeaders::ValueProxy<true, std::chrono::utc_clock::time_point>
IfModifiedSince
()
const
;
83
85
NHeaders::ValueProxy<false, std::chrono::utc_clock::time_point>
IfUnmodifiedSince
();
86
[[nodiscard]]
NHeaders::ValueProxy<true, std::chrono::utc_clock::time_point>
IfUnmodifiedSince
()
const
;
87
89
NHeaders::ValueProxy<false, std::chrono::utc_clock::time_point, string>
IfRange
();
90
[[nodiscard]]
NHeaders::ValueProxy<true, std::chrono::utc_clock::time_point, string>
IfRange
()
const
;
91
93
NHeaders::ListProxy<false, NHeaders::EntityTag>
IfMatch
();
94
[[nodiscard]]
NHeaders::ListProxy<true, NHeaders::EntityTag>
IfMatch
()
const
;
95
97
NHeaders::ValueProxy<false, NHeaders::EntityTag>
IfNoneMatch
();
98
[[nodiscard]]
NHeaders::ValueProxy<true, NHeaders::EntityTag>
IfNoneMatch
()
const
;
100
101
103
NHeaders::ListProxy<false, string>
AcceptLanguage
();
104
[[nodiscard]]
NHeaders::ListProxy<true, string>
AcceptLanguage
()
const
;
105
107
NHeaders::ListProxy<false, NHeaders::TeEnum>
Te
();
108
[[nodiscard]]
NHeaders::ListProxy<true, NHeaders::TeEnum>
Te
()
const
;
109
111
#pragma endregion
112
113
// #pragma region CORS Request Headers
114
// //! @name CORS Request Headers
115
// //! Headers sent by the client during Cross-Origin Resource Sharing.
116
// //! @{
117
//
118
// //! @brief The value of the Access-Control-Request-Headers for preflight requests.
119
// NHeaders::ListProxy<true, string>NHeaders::V<alueProxy<, string> AccessControlAllowCredentials();
120
// [[nodiscard]] NHeaders::ListProxy<false, string>NHeaders::ValueProxytruefalse, string> AccessControlAllowCredentials() const;
121
//
122
// //! @brief The value of the Access-Control-Request-Headers for preflight requests.
123
// NHeaders::ValueProxy<false, string> AccessControlAllowHeaders();
124
// [[nodiscard]] NHeaders::ValueProxy<true, string> AccessControlAllowHeaders() const;
125
//
126
// //! @brief The value of the Access-Control-Request-Headers for preflight requests.
127
// NHeaders::ValueProxy<false, string> AccessControlAllowMethods();
128
// [[nodiscard]] NHeaders::ValueProxy<true, string> AccessControlAllowMethods() const;
129
//
130
// //! @brief The value of the Access-Control-Request-Headers for preflight requests.
131
// NHeaders::ValueProxy<false, string> AccessControlAllowOrigin();
132
// [[nodiscard]] NHeaders::ValueProxy<true, string> AccessControlAllowOrigin() const;
133
//
134
//
135
// //! @brief The value of the Access-Control-Request-Headers for preflight requests.
136
// NHeaders::ValueProxy<false, string> AccessControlExposeAge();
137
// [[nodiscard]] NHeaders::ValueProxy<true, string> AccessControlExposeAge() const;
138
//
139
// //! @brief The value of the Access-Control-Request-Headers for preflight requests.
140
// NHeaders::ValueProxy<false, string> AccessControlExposeMethods();
141
// [[nodiscard]] NHeaders::ValueProxy<true, string> AccessControlExposeMethods() const;
142
//
143
//
144
// //! @brief The value of the Access-Control-Request-Method for preflight requests.
145
// NHeaders::ValueProxy<false, string> AccessControlRequestMethod();
146
// [[nodiscard]] NHeaders::ValueProxy<true, string> AccessControlRequestMethod() const;
147
//
148
// //! @brief The value of the Access-Control-Request-Headers for preflight requests.
149
// NHeaders::ValueProxy<false, string> AccessControlRequestHeaders();
150
// [[nodiscard]] NHeaders::ValueProxy<true, string> AccessControlRequestHeaders() const;
151
// //! @}
152
// #pragma endregion
153
};
154
};
EntityTag.hpp
Headers.hpp
_pch.hpp
Thoth::Http
Definition
Client.hpp:12
Thoth::Http::string
std::string string
Definition
Url.hpp:8
Thoth::Http::Headers
This class stores the headers from HTTP.
Definition
Headers.hpp:29
Thoth::Http::NHeaders::ListProxy
Definition
ListProxy.hpp:14
Thoth::Http::NHeaders::ValueProxy
Definition
ValueProxy.hpp:10
Thoth::Http::RequestHeaders
Represents the collection of HTTP headers associated with a request. Based on modern HTTP RFCs and in...
Definition
RequestHeaders.hpp:12
Thoth::Http::RequestHeaders::Host
NHeaders::ValueProxy< false, Url > Host()
Gets the Host header. Essential for HTTP/1.1 and SNI.
Thoth::Http::RequestHeaders::Referrer
NHeaders::ValueProxy< false, Url > Referrer()
The value of the Referer header (yes, it's misspelled in RFC).
Thoth::Http::RequestHeaders::Origin
NHeaders::ValueProxy< true, Url, std::monostate > Origin() const
Thoth::Http::RequestHeaders::IfMatch
NHeaders::ListProxy< false, NHeaders::EntityTag > IfMatch()
The value of the If-Match header.
Thoth::Http::RequestHeaders::Range
NHeaders::ListProxy< false, NHeaders::Range > Range()
The value of the Range header for partial content requests.
Thoth::Http::RequestHeaders::From
NHeaders::ValueProxy< false, string > From()
The value of the From header (email address of the user).
Thoth::Http::RequestHeaders::Range
NHeaders::ListProxy< true, NHeaders::Range > Range() const
Thoth::Http::RequestHeaders::IfUnmodifiedSince
NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point > IfUnmodifiedSince()
The value of the If-Unmodified-Since header.
Thoth::Http::RequestHeaders::ProxyAuthorization
NHeaders::ValueProxy< false, string > ProxyAuthorization()
The value of the Proxy-Authorization header.
Thoth::Http::RequestHeaders::Te
NHeaders::ListProxy< false, NHeaders::TeEnum > Te()
The value of the TE (Transfer Encoding) header.
Thoth::Http::RequestHeaders::IfModifiedSince
NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point > IfModifiedSince()
The value of the If-Modified-Since header.
Thoth::Http::RequestHeaders::IfNoneMatch
NHeaders::ValueProxy< true, NHeaders::EntityTag > IfNoneMatch() const
Thoth::Http::RequestHeaders::MaxForwards
NHeaders::ValueProxy< true, unsigned int > MaxForwards() const
Thoth::Http::RequestHeaders::Host
NHeaders::ValueProxy< true, Url > Host() const
Thoth::Http::RequestHeaders::Te
NHeaders::ListProxy< true, NHeaders::TeEnum > Te() const
Thoth::Http::RequestHeaders::GetCookiesView
auto GetCookiesView() const
Gets a readonly view of all Cookie values.
Thoth::Http::RequestHeaders::IfModifiedSince
NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point > IfModifiedSince() const
Thoth::Http::RequestHeaders::From
NHeaders::ValueProxy< true, string > From() const
Thoth::Http::RequestHeaders::AcceptLanguage
NHeaders::ListProxy< false, string > AcceptLanguage()
The value of the Accept-Language header.
Thoth::Http::RequestHeaders::MaxForwards
NHeaders::ValueProxy< false, unsigned int > MaxForwards()
The value of the Max-Forwards header for limiting proxy hops.
Thoth::Http::RequestHeaders::Authorization
NHeaders::ValueProxy< false, std::string > Authorization()
Thoth::Http::RequestHeaders::IfUnmodifiedSince
NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point > IfUnmodifiedSince() const
Thoth::Http::RequestHeaders::Authorization
NHeaders::ValueProxy< true, std::string > Authorization() const
Thoth::Http::RequestHeaders::IfRange
NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point, string > IfRange()
The value of the If-Range header.
Thoth::Http::RequestHeaders::GetNonValidatedView
auto GetNonValidatedView() const
Gets a view of the contents of this headers collection that does not parse nor validate data.
Thoth::Http::RequestHeaders::Url
string Url
Definition
RequestHeaders.hpp:42
Thoth::Http::RequestHeaders::AcceptLanguage
NHeaders::ListProxy< true, string > AcceptLanguage() const
Thoth::Http::RequestHeaders::IfMatch
NHeaders::ListProxy< true, NHeaders::EntityTag > IfMatch() const
Thoth::Http::RequestHeaders::ProxyAuthorization
NHeaders::ValueProxy< true, string > ProxyAuthorization() const
Thoth::Http::RequestHeaders::Origin
NHeaders::ValueProxy< false, Url, std::monostate > Origin()
The value of the Origin header. Used for CORS requests.
Thoth::Http::RequestHeaders::IfNoneMatch
NHeaders::ValueProxy< false, NHeaders::EntityTag > IfNoneMatch()
The value of the If-None-Match header.
Thoth::Http::RequestHeaders::Referrer
NHeaders::ValueProxy< true, Url > Referrer() const
Thoth::Http::RequestHeaders::IfRange
NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point, string > IfRange() const
include
Thoth
Http
NHeaders
Request
RequestHeaders.hpp
Generated by
1.9.8