-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Description
I need to make a GET request via "HTTPClient", but the data is GZIP compressed, how can I decompress it?
This code would have been normal.But the API was changed to gzip form, and the received content became garbled.
if (https.begin(client, "https://devapi.qweather.com/v7/weather/now?location=101070102&key=mykey")) { // HTTPS
Serial.print("[HTTPS] GET...\n");
int httpCode = https.GET();
if (httpCode > 0) {
Serial.printf("[HTTPS] GET... code: %d\n", httpCode);
if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
String payload = https.getString();
Serial.println(payload);
}
} else {
Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
}
https.end();
Metadata
Metadata
Assignees
Labels
No labels