Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodC++BuilderCode SnippetDelphiDemoFiremonkeyIOSOSXWindows

Secure Your REST Client With SSL And GZIP Compression In Delphi XE8 Firemonkey On Android And IOS

Delphi XE8 Firemonkey REST Client Demo With SSL And GZIP For Android And IOSIn Delphi XE8 Firemonkey the TRESTClient component is now backed by TNetHTTPClient which uses the native HTTP client on each platform (for example on IOS it uses NSURLConnection). This means that you no longer have to distribute OpenSSL libraries with your Delphi XE8 applications and you will be able to support SSL and GZIP. It should also support Deflate compression. When the native platform updates it’s SSL functionality you automatically take advantage of those updates as well. Under Delphi XE7 using GZIP was also possible. You want to use SSL to secure your application data and GZIP to reduce the size of your downloads especially on a mobile connection. This is especially important if you are building an enterprise app. Your web server must have GZIP enabled for the client to be able to use it. What I found with the new TNetHTTPClient component is that on IOS and Mac OSX the native NSURLConnection component automatically decompresses the content but on Windows and Android the content is still GZIPed. I am including a demo app for Android, IOS32, IOS64, Win32, Win64, and Mac OSX which contains a DecodeGZIPContent() function that utilizes TIdCompressorZlib.DecompressGzipStream depending on the platform where it is needed. Once you set the TRESTRequest.AcceptEncoding to ‘gzip, deflate’ the web server will know your client can accept GZIPed content and should send it to you. You should be able to use this demo with Appmethod as well. Here is the DecodeGZIPContent function from the demo:

Download the Delphi XE8 Firemonkey REST Client Demo With SSL And GZIP.

 

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidC++BuilderCode SnippetDelphiDemoFiremonkeyIOSOSXShowcaseWindows

Powerful Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS

AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

Significant Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux

C++BuilderDelphiIDEWindows

Professional SVG Icon Image List For Delphi 10.4 FireMonkey On Windows

AndroidC++BuilderDelphiFiremonkeyIOSLiveBindingsOSXWindows

Top Tips And Tricks To Speed Up Development With Delphi 10.4 FireMonkey On Android and IOS

Sign up for our Newsletter and
stay informed

Leave a Reply