Thoth
A functional, expressive, asynchronous C++26 webdev library
Loading...
Searching...
No Matches
RequestHeaders.hpp
Go to the documentation of this file.
1#pragma once
3
6
7namespace Thoth::Http {
8 // based in Microslop's HttpRequestHeaders
9
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).
41
42 using Url = string;
43
47
51
55
59
63
65 //void GetProtocol();
66 //[[nodiscard]] void GetProtocol() const;
67
71
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
83
87
91
95
100
101
105
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};
Definition Client.hpp:12
std::string string
Definition Url.hpp:8
This class stores the headers from HTTP.
Definition Headers.hpp:29
Definition ListProxy.hpp:14
Definition ValueProxy.hpp:10
Represents the collection of HTTP headers associated with a request. Based on modern HTTP RFCs and in...
Definition RequestHeaders.hpp:12
NHeaders::ValueProxy< false, Url > Host()
Gets the Host header. Essential for HTTP/1.1 and SNI.
NHeaders::ValueProxy< false, Url > Referrer()
The value of the Referer header (yes, it's misspelled in RFC).
NHeaders::ValueProxy< true, Url, std::monostate > Origin() const
NHeaders::ListProxy< false, NHeaders::EntityTag > IfMatch()
The value of the If-Match header.
NHeaders::ListProxy< false, NHeaders::Range > Range()
The value of the Range header for partial content requests.
NHeaders::ValueProxy< false, string > From()
The value of the From header (email address of the user).
NHeaders::ListProxy< true, NHeaders::Range > Range() const
NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point > IfUnmodifiedSince()
The value of the If-Unmodified-Since header.
NHeaders::ValueProxy< false, string > ProxyAuthorization()
The value of the Proxy-Authorization header.
NHeaders::ListProxy< false, NHeaders::TeEnum > Te()
The value of the TE (Transfer Encoding) header.
NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point > IfModifiedSince()
The value of the If-Modified-Since header.
NHeaders::ValueProxy< true, NHeaders::EntityTag > IfNoneMatch() const
NHeaders::ValueProxy< true, unsigned int > MaxForwards() const
NHeaders::ValueProxy< true, Url > Host() const
NHeaders::ListProxy< true, NHeaders::TeEnum > Te() const
auto GetCookiesView() const
Gets a readonly view of all Cookie values.
NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point > IfModifiedSince() const
NHeaders::ValueProxy< true, string > From() const
NHeaders::ListProxy< false, string > AcceptLanguage()
The value of the Accept-Language header.
NHeaders::ValueProxy< false, unsigned int > MaxForwards()
The value of the Max-Forwards header for limiting proxy hops.
NHeaders::ValueProxy< false, std::string > Authorization()
NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point > IfUnmodifiedSince() const
NHeaders::ValueProxy< true, std::string > Authorization() const
NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point, string > IfRange()
The value of the If-Range header.
auto GetNonValidatedView() const
Gets a view of the contents of this headers collection that does not parse nor validate data.
string Url
Definition RequestHeaders.hpp:42
NHeaders::ListProxy< true, string > AcceptLanguage() const
NHeaders::ListProxy< true, NHeaders::EntityTag > IfMatch() const
NHeaders::ValueProxy< true, string > ProxyAuthorization() const
NHeaders::ValueProxy< false, Url, std::monostate > Origin()
The value of the Origin header. Used for CORS requests.
NHeaders::ValueProxy< false, NHeaders::EntityTag > IfNoneMatch()
The value of the If-None-Match header.
NHeaders::ValueProxy< true, Url > Referrer() const
NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point, string > IfRange() const