NetServices: Add support for Basic authentication

Change-Id: I304104f7096fd935212e1bfa3e988e7945cb5cec
This commit is contained in:
Niels Sascha Reedijk
2022-05-29 15:13:54 +01:00
parent f751534257
commit f9d9d20245
7 changed files with 179 additions and 4 deletions
@@ -80,6 +80,12 @@ struct BHttpRedirectOptions {
};
struct BHttpAuthentication {
BString username;
BString password;
};
class BHttpRequest {
public:
// Constructors and Destructor
@@ -95,12 +101,14 @@ public:
// Access
bool IsEmpty() const noexcept;
const BHttpAuthentication* Authentication() const noexcept;
const BHttpFields& Fields() const noexcept;
const BHttpMethod& Method() const noexcept;
const BHttpRedirectOptions& Redirect() const noexcept;
const BUrl& Url() const noexcept;
// Named Setters
void SetAuthentication(const BHttpAuthentication& authentication);
void SetFields(const BHttpFields& fields);
void SetMethod(const BHttpMethod& method);
void SetRedirect(const BHttpRedirectOptions& redirectOptions);
@@ -75,6 +75,9 @@ private:
};
BString encode_to_base64(const BString& string);
}
}