Open source REST client libraries for Delphi

delphi-oop

delphi-oop includes a REST client to consume RESTful web services using your own annotated class (similar to JAX-RS). It supports Google OAuth 2.0 authentication. The library is mostly tested with Delphi XE and hosted on Google Code at https://code.google.com/p/delphi-oop/

Code example: (more examples on the project page)

TODataNorthwindClient = class(TSvRESTClient)
  public
    [GET] [Path('/Customers')] [Consumes(MEDIA_TYPE.JSON)]
    function GetCustomers(): TCustomers; virtual;
  end;

delphi-rest-client-api

This library by Fabricio Colombo to consume RESTful web services supports two implementations, using Indy 10 and WinHTTP. The API was tested in Delphi XE, XE2 and XE3 and is hosted on Github at https://github.com/fabriciocolombo/delphi-rest-client-api

Code example:

var
  vPerson : TPerson;
begin
  vPerson := RestClient.Resource('http://localhost:8080/java-rest-server/rest/person/1')
                     .Accept(RestUtils.MediaType_Json)
                     .Get<TPerson>();
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s