mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 21:17:18 +03:00
MacOS auth for Spotify
This commit is contained in:
@@ -55,8 +55,10 @@ class HTTPClient {
|
||||
void connect(const std::string& url);
|
||||
|
||||
void rawRequest(const std::string& method, const std::string& url,
|
||||
const std::string& content, Headers& headers);
|
||||
const std::vector<uint8_t>& content, Headers& headers);
|
||||
void get(const std::string& url, Headers headers = {});
|
||||
void post(const std::string& url, Headers headers = {},
|
||||
const std::vector<uint8_t>& body = {});
|
||||
|
||||
std::string_view body();
|
||||
std::vector<uint8_t> bytes();
|
||||
@@ -102,5 +104,14 @@ class HTTPClient {
|
||||
response->get(url, headers);
|
||||
return response;
|
||||
}
|
||||
|
||||
static std::unique_ptr<Response> post(const std::string& url,
|
||||
Headers headers = {},
|
||||
const std::vector<uint8_t>& body = {}) {
|
||||
auto response = std::make_unique<Response>();
|
||||
response->connect(url);
|
||||
response->post(url, headers, body);
|
||||
return response;
|
||||
}
|
||||
};
|
||||
} // namespace bell
|
||||
|
||||
Reference in New Issue
Block a user