Delphi XE5 - Using the new REST Client library components to connect to Web & Cloud services (Part 1)

Posted by on in Blogs
This REST BaaS (Backend as a Service) client tutorial shows how to use the Embarcadero REST Library for accessing REST-based web services (REST stands for Representational State Transfer). The library is available for all platforms that are supported by Delphi. The REST Library framework focuses on JSON as the representation format. XML is not explicitly supported.

Part 1:

1. Run "RESTDemos.exe" (built from  sample project C:\Users\Public\Documents\RAD Studio\12.0\Samples\Delphi\RESTDemo).







The TABS have REST Service Providers, like Discogs, Twitter, Facebook and DropBox.

A REST Request is a HTTP Request, same as you use in a Browser, except we get a JSON result, instead of HTML mark-up.  JSON, or JavaScript Object Notation, is a text-based open standard designed for human-readable data interchange.

Here we are looking at the Discogs Service.  The URL has a BASE-URL and the Parameters for the URL, are in the RESOURCE-URI.  For the {NAME}, it's a parameter that can be replaced.  In this example, we replaced it with the name "Kelly Clarkson" string.

This app was built using the new RAD Studio XE5 REST client components.

2. To EXECUTE the app, click on the "fetch artist-details" button and observe the JSON text as the response in the bottom part of the form.





The result is JSON Markup Language Response.  JSON is a hierarchical Markup Language.

This ends Part 1.  For Part 2, we'll create a Client App to use BaaS, using the new REST Client Components in Delphi XE5.


Comments

Check out more tips and tricks in this development video: