mirror of
https://github.com/arduino-libraries/ArduinoHttpClient.git
synced 2025-04-19 21:22:15 +03:00
Use http.endOfBodyReached() in example instead of tracking body len
This commit is contained in:
parent
255118660b
commit
7ee216f4aa
@ -87,7 +87,7 @@ void loop()
|
||||
char c;
|
||||
// Whilst we haven't timed out & haven't reached the end of the body
|
||||
while ( (http.connected() || http.available()) &&
|
||||
(bodyLen > 0 || bodyLen != HttpClient::kNoContentLengthHeader) &&
|
||||
(!http.endOfBodyReached()) &&
|
||||
((millis() - timeoutStart) < kNetworkTimeout) )
|
||||
{
|
||||
if (http.available())
|
||||
@ -96,7 +96,6 @@ void loop()
|
||||
// Print out this character
|
||||
Serial.print(c);
|
||||
|
||||
bodyLen--;
|
||||
// We read something, reset the timeout counter
|
||||
timeoutStart = millis();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user