HTTP request in loop()

Some delay between the GET and the the client.available() is okay. Two seconds is a long time for a local server. Perhaps 100ms is enough.

You have moved the client.connect() into the setup(), so the client.connect() is executed just once. There is however still no client.stop().

The difference between connected() and available() is:
The client.connect() opens a socket to a server. The client.connected() checks if the socket is still open, since the server could close it. The client.available() checks for incoming data.

To get data, the client.available() should be checked if there is any data. But also the client.connected() should be checked, since the server might have closed the connection. Some use both checks for every single byte that is read, but I don't do that. You use the readString to read data with a timeout. That's is okay. I use a timeout in my sketch, similar to the 'loopcount' in this example : Arduino Playground - WebServerST