Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::HttpClientSession Struct Reference

Optional caller-owned state layer above the stateless HttpClient core. More...

#include <HttpClientSession.h>

Public Member Functions

Result init (const HttpClientSessionMemory &memory)
 
void clear ()
 
void clearCookies ()
 
void clearAuthorizations ()
 
Result addAuthorization (StringSpan origin, StringSpan authorizationHeader)
 
bool findAuthorization (StringSpan origin, StringSpan &authorizationHeader) const
 
bool hasAuthorization (StringSpan origin) const
 
bool findCookie (StringSpan name, StringSpan domain, StringSpan path, HttpClientSessionCookie &cookie) const
 
bool hasCookie (StringSpan name, StringSpan domain, StringSpan path) const
 
Result prepareRequest (const HttpClientRequest &source, HttpClientRequest &prepared)
 
Result captureResponse (const HttpClientRequest &request, const HttpClientResponse &response)
 
Result beginRetry (HttpClientSessionRetryState &state, const HttpClientRequest &request, HttpClientSessionRetryPolicy policy) const
 
bool shouldRetry (HttpClientSessionRetryState &state, Result transportResult, const HttpClientResponse *response) const
 
bool isInitialized () const
 
size_t getNumCookies () const
 
size_t getNumAuthorizations () const
 

Static Public Member Functions

static Result makeBasicAuthorization (StringSpan username, StringSpan password, Span< char > destination, StringSpan &authorizationHeader)
 
static bool findBasicAuthChallenge (const HttpClientResponse &response, HttpClientSessionAuthChallenge::Target target, HttpClientSessionAuthChallenge &challenge)
 
static Result makeBasicAuthorizationForChallenge (const HttpClientResponse &response, HttpClientSessionAuthChallenge::Target target, StringSpan username, StringSpan password, Span< char > destination, StringSpan &authorizationHeader)
 
static bool isIdempotentMethod (HttpClientRequest::Method method)
 
static bool isRetryableStatusCode (int statusCode)
 

Detailed Description

Optional caller-owned state layer above the stateless HttpClient core.

This helper never owns memory. prepareRequest() returns views into the original request plus HttpClientSessionMemory::requestHeaders / headerScratch; start the operation before reusing the same session memory for another prepared request.


The documentation for this struct was generated from the following file: