19 DomainCookie = 1 << 2,
28 [[nodiscard]]
bool isInUse()
const {
return not name.
isEmpty(); }
37 [[nodiscard]]
bool isInUse()
const {
return not origin.
isEmpty(); }
55 Target target = Origin;
56 Scheme scheme = Unsupported;
59 [[nodiscard]]
const char* getTargetName()
const {
return getTargetName(target); }
60 [[nodiscard]]
const char* getSchemeName()
const {
return getSchemeName(scheme); }
61 [[nodiscard]]
static const char* getTargetName(Target target);
62 [[nodiscard]]
static const char* getSchemeName(Scheme scheme);
80 bool retryTransportErrors =
true;
81 bool retryHttpStatusCodes =
true;
82 bool retryNonIdempotentReplayableBody =
false;
88 HttpClientRequest::Method method = HttpClientRequest::HttpGET;
91 bool requestBodyReplayable =
true;
93 [[nodiscard]]
bool isStarted()
const {
return attemptsStarted > 0; }
94 [[nodiscard]]
bool hasAttemptsRemaining()
const {
return attemptsStarted < policy.maxAttempts; }
95 [[nodiscard]]
uint8_t getRemainingAttempts()
const
97 return attemptsStarted < policy.maxAttempts ?
static_cast<uint8_t>(policy.maxAttempts - attemptsStarted) : 0;
111 void clearAuthorizations();
115 [[nodiscard]]
bool hasAuthorization(
StringSpan origin)
const;
125 HttpClientSessionAuthChallenge::Target target,
128 HttpClientSessionAuthChallenge::Target target,
138 [[nodiscard]]
static bool isIdempotentMethod(HttpClientRequest::Method method);
139 [[nodiscard]]
static bool isRetryableStatusCode(
int statusCode);
141 [[nodiscard]]
bool isInitialized()
const {
return initialized; }
142 [[nodiscard]]
size_t getNumCookies()
const;
143 [[nodiscard]]
size_t getNumAuthorizations()
const;
149 [[nodiscard]]
Result appendMatchingCookies(
StringSpan url,
size_t& numHeaders);
153 size_t stateScratchUsed = 0;
154 size_t headerScratchUsed = 0;
155 bool initialized =
false;
unsigned char uint8_t
Platform independent (1) byte unsigned int.
Definition PrimitiveTypes.h:27
Configuration for an outgoing HTTP request.
Definition HttpClient.h:274
Parsed response metadata filled when headers arrive.
Definition HttpClient.h:303
Caller-managed authorization cache entry for one exact request origin.
Definition HttpClientSession.h:33
StringSpan authorizationHeader
Full Authorization header value, e.g. Basic ...
Definition HttpClientSession.h:35
StringSpan origin
scheme://host[:port]
Definition HttpClientSession.h:34
Authentication challenge parsed from response headers without owning memory.
Definition HttpClientSession.h:42
Cookie state owned by HttpClientSession caller-provided memory.
Definition HttpClientSession.h:14
Caller-owned memory for the optional HttpClientSession layer.
Definition HttpClientSession.h:67
Span< HttpClientSessionAuthCacheEntry > authEntries
Durable auth cache slots.
Definition HttpClientSession.h:70
Span< char > stateScratch
Append-only durable state string scratch.
Definition HttpClientSession.h:72
Span< HttpClientHeader > requestHeaders
Header workspace for prepared requests.
Definition HttpClientSession.h:68
Span< char > headerScratch
Per-prepare header value scratch.
Definition HttpClientSession.h:71
Span< HttpClientSessionCookie > cookies
Durable cookie slots.
Definition HttpClientSession.h:69
Retry policy used by HttpClientSessionRetryState.
Definition HttpClientSession.h:77
Caller-owned retry bookkeeping for one logical request.
Definition HttpClientSession.h:87
Optional caller-owned state layer above the stateless HttpClient core.
Definition HttpClientSession.h:107
An ascii string used as boolean result. SC_TRY macro forwards errors to caller.
Definition Result.h:13
View over a contiguous sequence of items (pointer + size in elements).
Definition Span.h:29
An read-only view over a string (to avoid including Strings library when parsing is not needed).
Definition StringSpan.h:37
constexpr bool isEmpty() const
Return true if StringView is empty.
Definition StringSpan.h:85