![]() |
Thoth
A functional, expressive, asynchronous C++26 webdev library
|
#include <ResponseHeaders.hpp>
Public Member Functions | |
Response Specific Proxies | |
Convenient calls to some headers. | |
| NHeaders::ValueProxy< false, NHeaders::AcceptRanges > | AcceptRanges () |
| Defines if the response accepts bytes or no (just "bytes" or "none" is available). | |
| NHeaders::ValueProxy< true, NHeaders::AcceptRanges > | AcceptRanges () const |
| Defines if the response accepts bytes or no (just "bytes" or "none" is available). | |
| NHeaders::ListProxy< false, NHeaders::MimeType > | AcceptPatch () |
| The value of the Accept-Patch header. | |
| NHeaders::ListProxy< true, NHeaders::MimeType > | AcceptPatch () const |
| The value of the Accept-Patch header. | |
| NHeaders::ListProxy< false, NHeaders::MimeType > | AcceptPost () |
| The value of the Accept-Patch header. | |
| NHeaders::ListProxy< true, NHeaders::MimeType > | AcceptPost () const |
| The value of the Accept-Patch header. | |
| NHeaders::ValueProxy< false, std::chrono::seconds > | Age () |
| Get how old this response has generated in the server, useful for caching. | |
| NHeaders::ValueProxy< true, std::chrono::seconds > | Age () const |
| Get how old this response has generated in the server, useful for caching. | |
| NHeaders::ValueProxy< false, NHeaders::EntityTag > | EntityTag () |
| The "ETag" header. | |
| NHeaders::ValueProxy< true, NHeaders::EntityTag > | EntityTag () const |
| The "ETag" header. | |
| NHeaders::ValueProxy< false, std::string > | Location () |
| The URL where this response pointers to. | |
| NHeaders::ValueProxy< true, std::string > | Location () const |
| The URL where this response pointers to. | |
| NHeaders::ValueProxy< false, std::string > | ProxyAuthenticate () |
| The "proxy-authenticate" header. | |
| NHeaders::ValueProxy< true, std::string > | ProxyAuthenticate () const |
| The "proxy-authenticate" header. | |
| NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point, std::chrono::seconds > | RetryAfter () |
| The date or cooldown when the endpoint will accept new responses. | |
| 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. | |
| NHeaders::ValueProxy< false, std::string > | Server () |
| The type of server. | |
| NHeaders::ValueProxy< true, std::string > | Server () const |
| The type of server. | |
| NHeaders::ListProxy< false, std::string > | Vary () |
| The "vary" header. | |
| NHeaders::ListProxy< true, std::string > | Vary () const |
| The "vary" header. | |
| NHeaders::ValueProxy< false, std::string > | WwwAuthenticate () |
| The types of authentication that the server utilizes. | |
| NHeaders::ValueProxy< true, std::string > | WwwAuthenticate () const |
| The types of authentication that the server utilizes. | |
Public Member Functions inherited from Thoth::Http::Headers | |
| Headers () | |
| Headers (const MapType &initAs) | |
| Create with an existing vector. | |
| Headers (std::initializer_list< HeaderPair > init) | |
| bool | Exists (HeaderKeyRef key) const |
| check if a key exists. | |
| bool | Exists (HeaderPairRef p) const |
| check if a key exists. | |
| bool | Exists (HeaderKeyRef key, HeaderValueRef val) const |
| check if a key=val exists. | |
| void | Add (HeaderPairRef p) |
| Add a value with the specified key. Append if already exists. | |
| void | Add (HeaderKeyRef key, HeaderValueRef val) |
| same as Add(HeaderPairRef p). | |
| void | Set (HeaderPairRef p) |
| Add a value with the specified key. Replace if already exists. | |
| void | Set (HeaderKeyRef key, HeaderValueRef val) |
| same as Add(HeaderPairRef p). | |
| bool | Remove (HeaderPairRef p) |
| Remove a value with the specified key. | |
| bool | Remove (HeaderKeyRef key, HeaderValueRef val) |
| same as Remove(HeaderPairRef p). | |
| bool | SetIfNull (HeaderPairRef p) |
| If key not exists, set it to value. | |
| bool | SetIfNull (HeaderKeyRef key, HeaderValueRef val) |
| same as SetIfNull(HeaderPairRef p). | |
| std::optional< HeaderValue * > | Get (HeaderKeyRef key) |
| Get the reference of a key but don't create if it not exists. | |
| std::optional< const HeaderValue * > | Get (HeaderKeyRef key) const |
| Get the reference of a key but don't create if it not exists. | |
| IterType | begin () |
| IterType | end () |
| CIterType | begin () const |
| CIterType | end () const |
| RIterType | rbegin () |
| RIterType | rend () |
| CRIterType | rbegin () const |
| CRIterType | rend () const |
| void | Clear () |
| Clear all keys. | |
| size_t | Size () const |
| bool | Empty () const |
| HeaderValue & | operator[] (HeaderKeyRef key) |
| bool | operator== (const Headers &other) const |
| NHeaders::ListProxy< false, NHeaders::MimeType > | Accept () |
| Accept-Encoding header (gzip, br, etc). | |
| NHeaders::ListProxy< true, NHeaders::MimeType > | Accept () const |
| NHeaders::ListProxy< false, NHeaders::AcceptEncodingEnum > | AcceptEncoding () |
| Accept-Encoding header (gzip, br, etc). | |
| NHeaders::ListProxy< true, NHeaders::AcceptEncodingEnum > | AcceptEncoding () const |
| NHeaders::ValueProxy< false, NHeaders::MimeType > | ContentType () |
| Defines the media type of the resource (MIME). | |
| NHeaders::ValueProxy< true, NHeaders::MimeType > | ContentType () const |
| Defines the media type of the resource (MIME). | |
| NHeaders::ValueProxy< false, uint64_t > | ContentLength () |
| The size of the entity-body in bytes. | |
| NHeaders::ValueProxy< true, uint64_t > | ContentLength () const |
| The size of the entity-body in bytes. | |
| NHeaders::ListProxy< false, NHeaders::ContentEncodingEnum > | ContentEncoding () |
| List of encodings (compression) applied to the entity. | |
| NHeaders::ListProxy< true, NHeaders::ContentEncodingEnum > | ContentEncoding () const |
| List of encodings (compression) applied to the entity. | |
| NHeaders::ListProxy< false, NHeaders::TransferEncodingEnum > | TransferEncoding () |
| List of compression applied to the entity. | |
| NHeaders::ListProxy< true, NHeaders::TransferEncodingEnum > | TransferEncoding () const |
| List of compression applied to the entity. | |
| NHeaders::ListProxy< false, std::string > | ContentLanguage () |
| Natural languages for the intended audience (e.g., "en-US"). | |
| NHeaders::ListProxy< true, std::string > | ContentLanguage () const |
| Natural languages for the intended audience (e.g., "en-US"). | |
| NHeaders::ValueProxy< false, std::string > | ContentLocation () |
| The specific location for the entity-body. | |
| NHeaders::ValueProxy< true, std::string > | ContentLocation () const |
| The specific location for the entity-body. | |
| NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point > | Date () |
| Date and time at which the message was originated. | |
| NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point > | Date () const |
| Date and time at which the message was originated. | |
| NHeaders::ListProxy< false, std::string > | Connection () |
| Options for the current connection. | |
| NHeaders::ListProxy< true, std::string > | Connection () const |
| Options for the current connection. | |
| NHeaders::ListProxy< false, NHeaders::Upgrade > | Upgrade () |
| Used to signal a protocol change (e.g., "websocket"). | |
| NHeaders::ListProxy< true, NHeaders::Upgrade > | Upgrade () const |
| Used to signal a protocol change (e.g., "websocket"). | |
| NHeaders::ListProxy< false, std::string > | Trailer () |
| Indicates header fields present in the trailer of a chunked message. | |
| NHeaders::ListProxy< true, std::string > | Trailer () const |
| Indicates header fields present in the trailer of a chunked message. | |
| NHeaders::ListProxy< false, std::string > | Via () |
| Path taken by the request/response through proxies (free std::string). | |
| NHeaders::ListProxy< true, std::string > | Via () const |
| Path taken by the request/response through proxies (free std::string). | |
Additional Inherited Members | |
Public Types inherited from Thoth::Http::Headers | |
| using | HeaderKey = NHeaders::HeaderKey |
| using | HeaderKeyRef = NHeaders::HeaderKeyRef |
| using | HeaderValue = NHeaders::HeaderValue |
| using | HeaderValueRef = NHeaders::HeaderValueRef |
| using | HeaderPair = NHeaders::HeaderPair |
| using | HeaderPairRef = NHeaders::HeaderPairRef |
| using | MapType = NHeaders::MapType |
| using | MapType = std::vector< HeaderPair > |
| using | IterType = decltype(MapType{}.begin()) |
| using | CIterType = decltype(MapType{}.cbegin()) |
| using | RIterType = decltype(MapType{}.rbegin()) |
| using | CRIterType = decltype(MapType{}.crbegin()) |
Static Public Member Functions inherited from Thoth::Http::Headers | |
| template<std::ranges::input_range R> | |
| static WebResult< Headers > | Parse (R &headers, size_t maxHeadersLength=1<< 16) |
| Tries to parse the headers from the raw TCP std::string. | |
| static Headers | DefaultHeaders () |
| NHeaders::ListProxy< false, NHeaders::MimeType > Thoth::Http::ResponseHeaders::AcceptPatch | ( | ) |
The value of the Accept-Patch header.
| NHeaders::ListProxy< true, NHeaders::MimeType > Thoth::Http::ResponseHeaders::AcceptPatch | ( | ) | const |
The value of the Accept-Patch header.
| NHeaders::ListProxy< false, NHeaders::MimeType > Thoth::Http::ResponseHeaders::AcceptPost | ( | ) |
The value of the Accept-Patch header.
| NHeaders::ListProxy< true, NHeaders::MimeType > Thoth::Http::ResponseHeaders::AcceptPost | ( | ) | const |
The value of the Accept-Patch header.
| NHeaders::ValueProxy< false, NHeaders::AcceptRanges > Thoth::Http::ResponseHeaders::AcceptRanges | ( | ) |
Defines if the response accepts bytes or no (just "bytes" or "none" is available).
| NHeaders::ValueProxy< true, NHeaders::AcceptRanges > Thoth::Http::ResponseHeaders::AcceptRanges | ( | ) | const |
Defines if the response accepts bytes or no (just "bytes" or "none" is available).
| NHeaders::ValueProxy< false, std::chrono::seconds > Thoth::Http::ResponseHeaders::Age | ( | ) |
Get how old this response has generated in the server, useful for caching.
| NHeaders::ValueProxy< true, std::chrono::seconds > Thoth::Http::ResponseHeaders::Age | ( | ) | const |
Get how old this response has generated in the server, useful for caching.
| NHeaders::ValueProxy< false, NHeaders::EntityTag > Thoth::Http::ResponseHeaders::EntityTag | ( | ) |
The "ETag" header.
| NHeaders::ValueProxy< true, NHeaders::EntityTag > Thoth::Http::ResponseHeaders::EntityTag | ( | ) | const |
The "ETag" header.
| NHeaders::ValueProxy< false, std::string > Thoth::Http::ResponseHeaders::Location | ( | ) |
The URL where this response pointers to.
| NHeaders::ValueProxy< true, std::string > Thoth::Http::ResponseHeaders::Location | ( | ) | const |
The URL where this response pointers to.
| NHeaders::ValueProxy< false, std::string > Thoth::Http::ResponseHeaders::ProxyAuthenticate | ( | ) |
The "proxy-authenticate" header.
| NHeaders::ValueProxy< true, std::string > Thoth::Http::ResponseHeaders::ProxyAuthenticate | ( | ) | const |
The "proxy-authenticate" header.
| NHeaders::ValueProxy< false, std::chrono::utc_clock::time_point, std::chrono::seconds > Thoth::Http::ResponseHeaders::RetryAfter | ( | ) |
The date or cooldown when the endpoint will accept new responses.
| NHeaders::ValueProxy< true, std::chrono::utc_clock::time_point, std::chrono::seconds > Thoth::Http::ResponseHeaders::RetryAfter | ( | ) | const |
The date or cooldown when the endpoint will accept new responses.
| NHeaders::ValueProxy< false, std::string > Thoth::Http::ResponseHeaders::Server | ( | ) |
The type of server.
| NHeaders::ValueProxy< true, std::string > Thoth::Http::ResponseHeaders::Server | ( | ) | const |
The type of server.
| NHeaders::ListProxy< false, std::string > Thoth::Http::ResponseHeaders::Vary | ( | ) |
The "vary" header.
| NHeaders::ListProxy< true, std::string > Thoth::Http::ResponseHeaders::Vary | ( | ) | const |
The "vary" header.
| NHeaders::ValueProxy< false, std::string > Thoth::Http::ResponseHeaders::WwwAuthenticate | ( | ) |
The types of authentication that the server utilizes.
| NHeaders::ValueProxy< true, std::string > Thoth::Http::ResponseHeaders::WwwAuthenticate | ( | ) | const |
The types of authentication that the server utilizes.