HTTP Protocol Related Improvements in Delphi 10.2.2

Posted by on in Tutorial

The new features for the HTTP client library offer more flexibility and options in terms of protocol and standards support. 

Better Secure Protocols Support

The first change is the improved support for security protocols. In the past it wasn't possible to specify the required security protocols (TLS1.1, TLS1.2, etc.) for an HTTP request. We have added a new enumeration, THTTPSecureProtocol with the values (SSL2, SSL3, TLS1, TLS11, TLS12). THPPTClient and related classes have now a SecureProtocols property which is a set based on that enumeration.

The property (available only at run-time) controls which security protocols to use and it is currently implemented only for Windows. This was requested in our Quality Portal at

HTTP Redirect Improvements

Another set of improvements is in the way the HTTP client library handles redirects. There is a new RedirectsWithGET runtime property offering another set of options, this time based on the following enumeration:

THTTPRedirectWithGET = (Post301, Post302, Post303, Post307, Post308, Put301, Put302, Put303, Put307, Put308, Delete301, Delete302, Delete303, Delete307, Delete308);

The property controls which request method and response status must be redirected using GET method and it was reported in several entries in QP, including

New REST Client Events OnNeedClientCert and OnAuthEvent

These events corresponds to their HTTPClient counterparts and are now surfaces at a higher level:

TRESTClient.OnNeedClientCertificate: TNeedClientCertificateEvent TRESTClient.OnAuthEvent: TCredentialAuthEvent

This was requested in

MIME Name Helper

We added a function that to the TEncoding support, which returns the encoding MIME for a speficied encoding:

function GetEncodingMimeName(AEncoding: TEncoding): string;

Changed TIniFile Behaviour

This one is totally unrelated, beside the fact it was also done in 10.2.2. The Ini File behavior was platform specific, not is it platform independent. On Windows, TIniFile ReadString ignores the case of Key parameter. On Linux, the ReadString call was case sensitive, leading to issues when migrating code and configuration files. Now by default TIniFile content structure (not the actual values) is treated in a case-insensitive way on all supported platforms.

Gold User, Rank: 7, Points: 457
Delphi and RAD Studio Product Manager at Embarcadero.


  • Dejan Mitic
    Dejan Mitic Tuesday, 13 March 2018

    Relation between REST CRUD operation and HTTP verbs are described at:

    Using HTTP Methods for RESTful Services

    Also, at Embarcadero REST overview it is covered with exmples:

    REST overview

    However, in the implementation of mapping PUT and POST, there is inconsistency:

    Datasnap REST

    Implemented behavior treat PUT (instead default POST) as method for inserting new resource, and returns code: 201(Create). Using POST (as REST service usually implement insert) for inserting a new resource returns the response 200(OK).

    Simply, in order to follow the REST rules, PUT and POST for UPDATE and INSERT should be swapped in next release:

    POST should be used for INSERT, by implementing a method prefixed with "accept" and returns 201(Create). Consider adding the Location field in the response HTTP Header according to standard behavior of POST for REST services.
    PUT should be used for UPDATE, by implementing a method prefixed with "update" and return 200(Ok).

  • Armindo D40760
    Armindo D40760 Wednesday, 14 February 2018

    Hi Marco,
    is there any sample that shows how to use pfx certificate file in a Delphi Rest Client app?
    Best regards

  • Jay F9562
    Jay F9562 Monday, 22 January 2018

    can you show an example of using THTTPSecureProtocol to set a specific protoocol?

  • Please login first in order for you to submit comments
  • Page :
  • 1

Check out more tips and tricks in this development video: