Thoth
A functional, expressive, asynchronous C++26 webdev library
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
ResponseHeaders.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
Thoth/Http/NHeaders/Headers.hpp
>
3
#include <
Thoth/Http/NHeaders/Response/Headers/_pch.hpp
>
4
5
namespace
Thoth::Http
{
6
// based in Microslop's HttpResponseHeaders
7
struct
ResponseHeaders
:
Headers
{
8
9
#pragma region Response Specific Proxies
10
14
15
17
NHeaders::ValueProxy<false, NHeaders::AcceptRanges>
AcceptRanges
();
19
[[nodiscard]]
NHeaders::ValueProxy<true, NHeaders::AcceptRanges>
AcceptRanges
()
const
;
20
22
NHeaders::ListProxy<false, NHeaders::MimeType>
AcceptPatch
();
24
NHeaders::ListProxy<true, NHeaders::MimeType>
AcceptPatch
()
const
;
25
27
NHeaders::ListProxy<false, NHeaders::MimeType>
AcceptPost
();
29
NHeaders::ListProxy<true, NHeaders::MimeType>
AcceptPost
()
const
;
30
31
33
NHeaders::ValueProxy<false, std::chrono::seconds>
Age
();
35
[[nodiscard]]
NHeaders::ValueProxy<true, std::chrono::seconds>
Age
()
const
;
36
37
// //! @brief Gets or sets the value of the Cache-Control header for an HTTP response.
38
// NHeaders::ValueProxy<false, bool> CacheControl();
39
// //! @copybrief CacheControl
40
// [[nodiscard]] NHeaders::ValueProxy<true, bool> CacheControl() const;
41
43
NHeaders::ValueProxy<false, NHeaders::EntityTag>
EntityTag
();
45
[[nodiscard]]
NHeaders::ValueProxy<true, NHeaders::EntityTag>
EntityTag
()
const
;
46
48
NHeaders::ValueProxy<false, std::string>
Location
();
// TODO: Improve Url before change the type
50
[[nodiscard]]
NHeaders::ValueProxy<true, std::string>
Location
()
const
;
51
52
// //! @brief Gets a view of the contents of this headers collection that does not parse nor validate the data upon access.
53
// NHeaders::ValueProxy<false, bool> NonValidated();
54
// //! @copybrief NonValidated
55
// [[nodiscard]] NHeaders::ValueProxy<true, bool> NonValidated() const;
56
58
NHeaders::ValueProxy<false, std::string>
ProxyAuthenticate
();
60
[[nodiscard]]
NHeaders::ValueProxy<true, std::string>
ProxyAuthenticate
()
const
;
61
63
NHeaders::ValueProxy<false, std::chrono::utc_clock::time_point, std::chrono::seconds>
RetryAfter
();
65
[[nodiscard]]
NHeaders::ValueProxy<true, std::chrono::utc_clock::time_point, std::chrono::seconds>
RetryAfter
()
const
;
66
68
NHeaders::ValueProxy<false, std::string>
Server
();
70
[[nodiscard]]
NHeaders::ValueProxy<true, std::string>
Server
()
const
;
71
72
// TODO: I dont know if I will implement this
73
// //! @brief Gets the value of the Trailer header for an HTTP response.
74
// NHeaders::ValueProxy<false, bool> Trailer();
75
// //! @copybrief Trailer
76
// [[nodiscard]] NHeaders::ValueProxy<true, bool> Trailer() const;
77
78
80
NHeaders::ListProxy<false, std::string>
Vary
();
82
[[nodiscard]]
NHeaders::ListProxy<true, std::string>
Vary
()
const
;
83
84
86
NHeaders::ValueProxy<false, std::string>
WwwAuthenticate
();
88
[[nodiscard]]
NHeaders::ValueProxy<true, std::string>
WwwAuthenticate
()
const
;
89
91
92
#pragma endregion
93
};
94
}
Headers.hpp
_pch.hpp
Thoth::Http
Definition
Client.hpp:12
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::ResponseHeaders
Definition
ResponseHeaders.hpp:7
Thoth::Http::ResponseHeaders::AcceptRanges
NHeaders::ValueProxy< false, NHeaders::AcceptRanges > AcceptRanges()
Defines if the response accepts bytes or no (just "bytes" or "none" is available).
Thoth::Http::ResponseHeaders::RetryAfter
NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point, std::chrono::seconds > RetryAfter() const
The date or cooldown when the endpoint will accept new responses.
Thoth::Http::ResponseHeaders::AcceptPost
NHeaders::ListProxy< false, NHeaders::MimeType > AcceptPost()
The value of the Accept-Patch header.
Thoth::Http::ResponseHeaders::AcceptPatch
NHeaders::ListProxy< false, NHeaders::MimeType > AcceptPatch()
The value of the Accept-Patch header.
Thoth::Http::ResponseHeaders::ProxyAuthenticate
NHeaders::ValueProxy< true, std::string > ProxyAuthenticate() const
The "proxy-authenticate" header.
Thoth::Http::ResponseHeaders::Server
NHeaders::ValueProxy< false, std::string > Server()
The type of server.
Thoth::Http::ResponseHeaders::AcceptRanges
NHeaders::ValueProxy< true, NHeaders::AcceptRanges > AcceptRanges() const
Defines if the response accepts bytes or no (just "bytes" or "none" is available).
Thoth::Http::ResponseHeaders::Location
NHeaders::ValueProxy< true, std::string > Location() const
The URL where this response pointers to.
Thoth::Http::ResponseHeaders::Location
NHeaders::ValueProxy< false, std::string > Location()
The URL where this response pointers to.
Thoth::Http::ResponseHeaders::EntityTag
NHeaders::ValueProxy< true, NHeaders::EntityTag > EntityTag() const
The "ETag" header.
Thoth::Http::ResponseHeaders::WwwAuthenticate
NHeaders::ValueProxy< true, std::string > WwwAuthenticate() const
The types of authentication that the server utilizes.
Thoth::Http::ResponseHeaders::AcceptPatch
NHeaders::ListProxy< true, NHeaders::MimeType > AcceptPatch() const
The value of the Accept-Patch header.
Thoth::Http::ResponseHeaders::AcceptPost
NHeaders::ListProxy< true, NHeaders::MimeType > AcceptPost() const
The value of the Accept-Patch header.
Thoth::Http::ResponseHeaders::ProxyAuthenticate
NHeaders::ValueProxy< false, std::string > ProxyAuthenticate()
The "proxy-authenticate" header.
Thoth::Http::ResponseHeaders::RetryAfter
NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point, std::chrono::seconds > RetryAfter()
The date or cooldown when the endpoint will accept new responses.
Thoth::Http::ResponseHeaders::Server
NHeaders::ValueProxy< true, std::string > Server() const
The type of server.
Thoth::Http::ResponseHeaders::Age
NHeaders::ValueProxy< false, std::chrono::seconds > Age()
Get how old this response has generated in the server, useful for caching.
Thoth::Http::ResponseHeaders::EntityTag
NHeaders::ValueProxy< false, NHeaders::EntityTag > EntityTag()
The "ETag" header.
Thoth::Http::ResponseHeaders::Age
NHeaders::ValueProxy< true, std::chrono::seconds > Age() const
Get how old this response has generated in the server, useful for caching.
Thoth::Http::ResponseHeaders::WwwAuthenticate
NHeaders::ValueProxy< false, std::string > WwwAuthenticate()
The types of authentication that the server utilizes.
Thoth::Http::ResponseHeaders::Vary
NHeaders::ListProxy< true, std::string > Vary() const
The "vary" header.
Thoth::Http::ResponseHeaders::Vary
NHeaders::ListProxy< false, std::string > Vary()
The "vary" header.
include
Thoth
Http
NHeaders
Response
ResponseHeaders.hpp
Generated by
1.9.8