1#ifndef SOURCEMETA_CORE_HTTP_H_
2#define SOURCEMETA_CORE_HTTP_H_
4#ifndef SOURCEMETA_CORE_HTTP_EXPORT
5#include <sourcemeta/core/http_export.h>
9#include <sourcemeta/core/http_aws_sigv4.h>
10#include <sourcemeta/core/http_error.h>
11#include <sourcemeta/core/http_message.h>
12#include <sourcemeta/core/http_method.h>
13#include <sourcemeta/core/http_problem.h>
14#include <sourcemeta/core/http_status.h>
15#include <sourcemeta/core/http_syntax.h>
16#include <sourcemeta/core/http_system.h>
21#include <initializer_list>
38namespace sourcemeta::core {
63SOURCEMETA_CORE_HTTP_EXPORT
65 std::initializer_list<std::string_view> candidates)
82SOURCEMETA_CORE_HTTP_EXPORT
84 const std::string_view accept_header,
85 std::initializer_list<std::string_view> media_types)
noexcept -> bool;
100SOURCEMETA_CORE_HTTP_EXPORT
102 const std::string_view media_type)
noexcept
121SOURCEMETA_CORE_HTTP_EXPORT
123 const std::string_view accept_language_header,
124 std::initializer_list<std::string_view> candidates) -> std::string_view;
139SOURCEMETA_CORE_HTTP_EXPORT
141 const std::string_view accept_encoding_header,
143 -> std::optional<HTTPContentEncoding>;
159SOURCEMETA_CORE_HTTP_EXPORT
161 -> std::optional<std::chrono::system_clock::time_point>;
179SOURCEMETA_CORE_HTTP_EXPORT
181 -> std::optional<std::chrono::seconds>;
193 std::span<const std::pair<std::string_view, std::string_view>>
parameters{};
209SOURCEMETA_CORE_HTTP_EXPORT
224SOURCEMETA_CORE_HTTP_EXPORT
244SOURCEMETA_CORE_HTTP_EXPORT
262SOURCEMETA_CORE_HTTP_EXPORT
288 std::optional<std::string_view>
path{};
290 std::optional<std::string_view>
domain{};
292 std::optional<std::chrono::seconds>
max_age{};
318SOURCEMETA_CORE_HTTP_EXPORT
337SOURCEMETA_CORE_HTTP_EXPORT
352SOURCEMETA_CORE_HTTP_EXPORT
354 -> std::optional<std::string>;
369SOURCEMETA_CORE_HTTP_EXPORT
371 const std::string_view header_value,
372 std::initializer_list<std::string_view> tokens)
noexcept -> bool;
388SOURCEMETA_CORE_HTTP_EXPORT
std::string_view rel
The link relation type.
Definition http.h:191
bool secure
Whether the cookie is only sent over secure channels.
Definition http.h:296
std::optional< std::chrono::seconds > max_age
The cookie lifetime.
Definition http.h:292
bool http_only
Whether the cookie is withheld from scripts.
Definition http.h:294
std::optional< std::string_view > domain
The host the cookie is scoped to.
Definition http.h:290
std::string_view name
The cookie name.
Definition http.h:284
std::span< const std::pair< std::string_view, std::string_view > > parameters
The additional target attributes of the link.
Definition http.h:193
std::optional< HTTPCookieSameSite > same_site
The cross-site request policy for the cookie.
Definition http.h:298
std::optional< std::string_view > path
The path the cookie is scoped to.
Definition http.h:288
std::string_view target
The link target reference.
Definition http.h:189
std::string_view value
The cookie value.
Definition http.h:286
SOURCEMETA_CORE_HTTP_EXPORT auto http_match_accept_language(const std::string_view accept_language_header, std::initializer_list< std::string_view > candidates) -> std::string_view
SOURCEMETA_CORE_HTTP_EXPORT auto http_from_date(const std::string_view value) noexcept -> std::optional< std::chrono::system_clock::time_point >
SOURCEMETA_CORE_HTTP_EXPORT auto http_field_list_contains_any(const std::string_view header_value, std::initializer_list< std::string_view > tokens) noexcept -> bool
HTTPCookieSameSite
Definition http.h:267
SOURCEMETA_CORE_HTTP_EXPORT auto http_parse_bearer(const std::string_view authorization) noexcept -> std::string_view
SOURCEMETA_CORE_HTTP_EXPORT auto http_match_accept(const std::string_view accept_header, std::initializer_list< std::string_view > candidates) -> std::string_view
SOURCEMETA_CORE_HTTP_EXPORT auto http_serialize_cookie(const HTTPCookie &cookie, std::string &out) -> bool
SOURCEMETA_CORE_HTTP_EXPORT auto http_content_type_matches(const std::string_view content_type_header, const std::string_view media_type) noexcept -> bool
SOURCEMETA_CORE_HTTP_EXPORT auto http_format_links(std::span< const HTTPLink > links, std::string &out) -> void
SOURCEMETA_CORE_HTTP_EXPORT auto http_negotiate_encoding(const std::string_view accept_encoding_header, const HTTPContentEncoding server_preference) noexcept -> std::optional< HTTPContentEncoding >
SOURCEMETA_CORE_HTTP_EXPORT auto http_format_link(const HTTPLink &link, std::string &out) -> void
SOURCEMETA_CORE_HTTP_EXPORT auto http_accept_includes_all(const std::string_view accept_header, std::initializer_list< std::string_view > media_types) noexcept -> bool
SOURCEMETA_CORE_HTTP_EXPORT auto http_cookie_valid(const HTTPCookie &cookie) -> bool
HTTPContentEncoding
Definition http.h:42
SOURCEMETA_CORE_HTTP_EXPORT auto http_cache_control_max_age(const std::string_view cache_control) noexcept -> std::optional< std::chrono::seconds >
@ Strict
The cookie is withheld from every cross-site request.
Definition http.h:269
@ None
The cookie is sent on every cross-site request.
Definition http.h:273
@ Lax
The cookie is sent on top-level cross-site navigations only.
Definition http.h:271
@ Identity
The identity coding that applies no transformation.
Definition http.h:44
@ GZIP
The gzip coding per RFC 9110 ยง8.4.1.3.
Definition http.h:46