Is polling required? Does a timeout need to be set?
The current documentation states that something is deprecated (axTLS) and something apparently not (BearSSL), but it does not give specifics.
The example at
https://github.com/esp8266/Arduino/blob ... equest.ino
does not seem to be using either of them (unless namespace BearSSL is standard).
Nor does the example seem to be waiting for the response.
It checks client.connected() in https://github.com/esp8266/Arduino/blob ... st.ino#L76 to read the response.
Looking for documentation:
- https://arduino-esp8266.readthedocs.io/ ... class.html is mostly about Certificate and states
In the background the library axtls is used.(contradiction!) but refers to
- https://arduino-esp8266.readthedocs.io/ ... mples.html
This seems to do what I was looking for:
https://arduino-esp8266.readthedocs.io/ ... the-server states
After sending the request we should wait for a reply and then process received information.
although to me it is not obvious that and how
while (client.connected()) {
String line = client.readStringUntil('\n');
if (line == "\r") {
Serial.println("headers received");
break;
}
}is waiting for the response.
Sources:
- https://github.com/esp8266/Arduino/blob ... ntSecure.h
- https://github.com/esp8266/Arduino/blob ... L.cpp#L259
This is where connected() is implemented, unfortunately without any comments.
So I assume that the loop is polling for data as long as the connection is alive, reading nothing, until the header's "\r\n" finally comes in.
Does this mean the whole response has been received at this time? How is large response data intended to be handled (10k+)?