print out debug messages

This commit is contained in:
helgeerbe 2023-09-15 09:57:25 +02:00
parent f7bd4a40d8
commit 2f9539e4b3

View File

@ -111,6 +111,8 @@ bool HttpPowerMeterClass::httpRequest(const char* url, Auth authType, const char
int httpCode = httpClient.GET(); int httpCode = httpClient.GET();
MessageOutput.printf("[HttpPowerMeter] httpCode %d \r\n", httpCode);
if (httpCode == HTTP_CODE_UNAUTHORIZED && authType == Auth::digest) { if (httpCode == HTTP_CODE_UNAUTHORIZED && authType == Auth::digest) {
// Handle authentication challenge // Handle authentication challenge
char realm[256]; // Buffer to store the realm received from the server char realm[256]; // Buffer to store the realm received from the server
@ -161,7 +163,9 @@ bool HttpPowerMeterClass::httpRequest(const char* url, Auth authType, const char
authorization += response; authorization += response;
authorization += "\", algorithm=SHA-256"; authorization += "\", algorithm=SHA-256";
httpClient.addHeader("Authorization", authorization); httpClient.addHeader("Authorization", authorization);
MessageOutput.printf("[HttpPowerMeter] authorization header %s \r\n", authorization.c_str());
httpCode = httpClient.GET(); httpCode = httpClient.GET();
MessageOutput.printf("[HttpPowerMeter] 2nd httpCode %d \r\n", httpCode);
} }
} }
} }