mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-28 21:30:54 +03:00
MacOS auth for Spotify
This commit is contained in:
@@ -27,7 +27,7 @@ HTTPClient::Response::~Response() {
|
||||
|
||||
void HTTPClient::Response::rawRequest(const std::string& url,
|
||||
const std::string& method,
|
||||
const std::string& content,
|
||||
const std::vector<uint8_t>& content,
|
||||
Headers& headers) {
|
||||
urlParser = bell::URLParser::parse(url);
|
||||
|
||||
@@ -50,6 +50,10 @@ void HTTPClient::Response::rawRequest(const std::string& url,
|
||||
}
|
||||
|
||||
socketStream << reqEnd;
|
||||
// Write request body
|
||||
if (content.size() > 0) {
|
||||
socketStream.write((const char*)content.data(), content.size());
|
||||
}
|
||||
socketStream.flush();
|
||||
|
||||
// Parse response
|
||||
@@ -115,7 +119,13 @@ void HTTPClient::Response::readResponseHeaders() {
|
||||
|
||||
void HTTPClient::Response::get(const std::string& url, Headers headers) {
|
||||
std::string method = "GET";
|
||||
return this->rawRequest(url, method, "", headers);
|
||||
return this->rawRequest(url, method, {}, headers);
|
||||
}
|
||||
|
||||
void HTTPClient::Response::post(const std::string& url, Headers headers,
|
||||
const std::vector<uint8_t>& body) {
|
||||
std::string method = "POST";
|
||||
return this->rawRequest(url, method, body, headers);
|
||||
}
|
||||
|
||||
size_t HTTPClient::Response::contentLength() {
|
||||
|
||||
Reference in New Issue
Block a user