Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By androidfanboy
#74002 Hi there,

With the ESP8266HTTPClient library using "http.begin()" and "http.GET()" functions the GET requests I am able to read a response very quickly using "payload = http.getString()". However, when using the manual way of connecting with WiFiClient or WiFiClientSecure and sending and receiving the lines manually, it takes up to 5s to read the response from the server. I receive the headers almost immediately after sending, but the actual server response content comes 3-4s after the headers. I use "client.connect()" then use a single "client.print()" line to do a GET request and then use "client.readStringUntil('\n')" to get the headers, then to get the rest of the response. Pretty straightforward and it works, but the responses are slow to come in.

What's the difference here and why is it taking so long doing it manually compared to the HTTPClient functions? Is there something hidden behind the library that I'm missing when doing it manually?

Thanks!
User avatar
By androidfanboy
#74009 Yea, probably a good idea, I figured that, but was wondering if anyone could point me in the right direction straight away. I'll have to dig in the source code to see what's going on there. It just doesn't make sense that using the default "manual" way would be much slower than using that library, especially since most people probably use the standard WiFiClient library.