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.

Secure Your REST Client With SSL And GZIP Compression In Delphi XE8 Firemonkey On Android And IOS by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.

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

  1. Lewis Wong says:

    REST not working under iOS64!

  2. Lewis Wong says:

    Sorry for false alarm, your sample is working, my App doesn’t work, I will check it out myself.

  3. Pingback: Ten Tips For Migrating From C# And .NET To Multi Platform Object Pascal And Delphi Firemonkey | Delphi XE5 XE6 XE7 XE8 Firemonkey, Delphi Android, Delphi IOS

  4. Pingback: Secure App Connections With SSH Tunneling In Delphi XE8 Firemonkey On #Android And #IOS | Delphi XE5 XE6 XE7 XE8 Firemonkey, Delphi Android, Delphi IOS

  5. Pingback: Ten Tips For Building Professional Multi Platform Enterprise Apps With Delphi XE8 Firemonkey | Delphi XE5 XE6 XE7 XE8 Firemonkey, Delphi Android, Delphi IOS

  6. Pingback: Ten Tips For Building Professional Multi Platform Enterprise Apps With Firemonkey | Firemonkey eXplore

  7. joejim says:

    timeout is not working on ios!!!

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Delphi XE8 Firemonkey Native Controls For IOS
Massive Suite Of Native IOS Controls And Demos For Delphi XE8 Firemonkey On IOS

Developer Babak Yaghoobi has updated his DPF Native IOS control suite (DPF IOS) to support Delphi XE8 Firemonkey. In Firemonkey...

Close