bearer.hpp
1 #ifndef XXHR_BEARER_H
2 #define XXHR_BEARER_H
3 
4 #include <string>
5 
6 #include "defines.hpp"
7 
8 namespace xxhr {
9 
16 class Bearer {
17  public:
18 
20  Bearer(const std::string& token)
21  : auth_string_{token} {}
22 
23  const char* GetAuthString() const noexcept { return auth_string_.data(); }
24 
25  private:
26  std::string auth_string_;
27 };
28 
29 } // namespace xxhr
30 
31 #endif
xxhr::Bearer
Some Web APIs requires authenticating via HTTP Basic auth ( i.e. base64 encoded user and password aut...
Definition: bearer.hpp:16
xxhr
main library namespace
Definition: api.hpp:20
xxhr::Bearer::Bearer
Bearer(const std::string &token)
Token for bearer authentication.
Definition: bearer.hpp:20