Closed sandeepmistry closed 7 years ago
Hmm, I don't think the library can rely on behavior of a patched core class.
@zonque
Hmm, I don't think the library can rely on behavior of a patched core class.
For cores without the fix something like this can be used:
String response = client.responseBody();
if (httpClient.contentLength() > response.length()) {
// reading response body failed
} else {
Serial.print("Response: ");
Serial.println(response);
}
Return invalidated String if memory allocation fails or content length does not match body data length. Also, use timed reads to support responses without a content length.
In order to perform the following check, a patched version of String is needed (see https://github.com/arduino/ArduinoCore-samd/pull/153 and https://github.com/arduino/Arduino/pull/5127):