NetServices: Add/rework the MaxRedirections, Timeout and StopOnError options

Change-Id: I4e59b51c16c6777941dc92ce02505386257dad03
This commit is contained in:
Niels Sascha Reedijk
2022-06-03 09:40:42 +01:00
parent f9d9d20245
commit 2f3b9b18ac
6 changed files with 164 additions and 69 deletions
+6 -8
View File
@@ -74,12 +74,6 @@ private:
};
struct BHttpRedirectOptions {
bool followRedirect = true;
uint8 maxRedirections = 8;
};
struct BHttpAuthentication {
BString username;
BString password;
@@ -103,15 +97,19 @@ public:
bool IsEmpty() const noexcept;
const BHttpAuthentication* Authentication() const noexcept;
const BHttpFields& Fields() const noexcept;
uint8 MaxRedirections() const noexcept;
const BHttpMethod& Method() const noexcept;
const BHttpRedirectOptions& Redirect() const noexcept;
bool StopOnError() const noexcept;
bigtime_t Timeout() const noexcept;
const BUrl& Url() const noexcept;
// Named Setters
void SetAuthentication(const BHttpAuthentication& authentication);
void SetFields(const BHttpFields& fields);
void SetMaxRedirections(uint8 maxRedirections);
void SetMethod(const BHttpMethod& method);
void SetRedirect(const BHttpRedirectOptions& redirectOptions);
void SetStopOnError(bool stopOnError);
void SetTimeout(bigtime_t timeout);
void SetUrl(const BUrl& url);
// Serialization