The RTL provides two components that you can use to send HTTP requests to servers and handle their responses:
TNetHTTPClient
TNetHTTPRequest
Alternatively, as we saw in Chapter 3, Knowing Your Friends – the Delphi RTL you can use an instance of THTTPClient
to manage your HTTP requests.
Why use these components instead of good old TidHTTP
from the INDY suite? The reasons have been explained in Chapter 3, Knowing Your Friends – the Delphi RTL however, in this recipe we'll use the new HTTP client to show how much the deployment is simplified, also in mobile apps, using these new components instead of the INDY ones, at least for HTTP communications.
Long story short, Embarcadero developed a native HTTP client library that is not based on INDY nor OpenSSL, but then relies on the OS API to implement HTTP protocol. So, when Microsoft, Apple or Google release a new security patch, your application is already updated. Great! You simply rely on the OS security...