All Projects → viniciussanchez → Restrequest4delphi

viniciussanchez / Restrequest4delphi

Licence: mit
API to consume REST services written in any programming language with support to Lazarus and Delphi

Programming Languages

pascal
1382 projects
delphi
115 projects

Projects that are alternatives of or similar to Restrequest4delphi

Ngx Restangular
Restangular for Angular 2 and higher versions
Stars: ✭ 787 (+385.8%)
Mutual labels:  api, rest, request
Smoke
💨 Simple yet powerful file-based mock server with recording abilities
Stars: ✭ 142 (-12.35%)
Mutual labels:  api, rest, simple
Examples
Examples of Mock Service Worker usage with various frameworks and libraries.
Stars: ✭ 163 (+0.62%)
Mutual labels:  api, rest, request
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+32648.15%)
Mutual labels:  api, rest, client
Bitcoin Core
A modern Bitcoin Core REST and RPC client.
Stars: ✭ 379 (+133.95%)
Mutual labels:  rest, request, client
Horse
Fast, opinionated, minimalist web framework for Delphi
Stars: ✭ 295 (+82.1%)
Mutual labels:  api, rest, lazarus
Verb
Organize and send HTTP requests from Emacs
Stars: ✭ 205 (+26.54%)
Mutual labels:  api, rest, client
Purest
REST API Client Library
Stars: ✭ 448 (+176.54%)
Mutual labels:  api, rest, client
Flickr Sdk
Almost certainly the best Flickr API client in the world for node and the browser
Stars: ✭ 104 (-35.8%)
Mutual labels:  api, rest, client
Python Twitch Client
Python wrapper for Twitch API
Stars: ✭ 137 (-15.43%)
Mutual labels:  api, client
Poloniex Api Node
Poloniex API client for REST and WebSocket API
Stars: ✭ 138 (-14.81%)
Mutual labels:  api, rest
Postman Bdd
A BDD test framework for Postman and Newman
Stars: ✭ 139 (-14.2%)
Mutual labels:  api, rest
Open Rest
Standard rest server, Base on restify and sequelize
Stars: ✭ 136 (-16.05%)
Mutual labels:  api, rest
Notion Js
🤯 Notion API
Stars: ✭ 136 (-16.05%)
Mutual labels:  api, client
Strapi Plugin Comments
A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
Stars: ✭ 138 (-14.81%)
Mutual labels:  api, rest
Aping
angular module to get and display data by adding html-attributes
Stars: ✭ 135 (-16.67%)
Mutual labels:  api, rest
Subzero Starter Kit
Starter Kit and tooling for authoring GraphQL/REST API backends with subZero
Stars: ✭ 136 (-16.05%)
Mutual labels:  api, rest
Grafanajsondatasource
Grafana datasource to load JSON data over your arbitrary HTTP backend
Stars: ✭ 146 (-9.88%)
Mutual labels:  api, rest
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: ✭ 146 (-9.88%)
Mutual labels:  api, rest
Api Guidelines
adidas group API design guidelines
Stars: ✭ 147 (-9.26%)
Mutual labels:  api, rest

Horse


RESTRequest4Delphi is a API to consume REST services written in any programming language.
Designed to facilitate development, in a simple and minimalist way.


⚙️ Installation

Prerequisites: DataSet-Serialize - This is a DataSet serializer for Delphi

  • Manual installation: Add the following folders to your project, in Project > Options > Resource Compiler > Directories and Conditionals > Include file search path
../RESTRequest4Delphi/src
  • Installation using the Boss:
boss install github.com/viniciussanchez/RESTRequest4Delphi

🔰 Engines

By default, the components TRESTRequest, TRESTResponse and TRESTClient are used to make requests when your using Delphi. If you use Lazarus, the Indy components are used by default. The RESTRequest4Delphi has support to three enginies to make requests: RESTClient, Indy and NetHTTP. You can change the engine to make requests. To do this, simply define in: Project > Options > Delphi Compiler > Conditional defines the compiler directive RR4D_INDY or RR4D_NETHTTP

Note: for Lazarus, only the engine using Indy is available and it is already the default. You don't need to define directive.

⚡️ Quickstart

You need to use RESTRequest4D

uses RESTRequest4D;
  • GET
var
  LResponse: IResponse;
begin
  LResponse := TRequest.New.BaseURL('http://localhost:8888/users')
    .AddHeader('HeaderName', 'HeaderValue')
    .AddParam('ParameterName', 'ParameterValue')
    .Accept('application/json')
    .Get;
  if LResponse.StatusCode = 200 then
    ShowMessage(LResponse.Content);
end;
  • GET AS DATASET
begin
  TRequest.New.BaseURL('http://localhost:8888/users')
    .Accept('application/json')
    .DataSetAdapter(FDMemTable)
    .Get;
end;
  • POST
begin
  TRequest.New.BaseURL('http://localhost:8888/users')
    .Accept('application/json')
    .AddBody('{"name":"Vinicius","lastName":"Sanchez","email":"[email protected]"}')
    .Post;
end;
  • PUT
begin
  TRequest.New.BaseURL('http://localhost:8888/users/1')
    .Accept('application/json')
    .AddBody('{"name":"Vinicius","lastName":"Scandelai Sanchez","email":"[email protected]"}')
    .Put;
end;
  • DELETE
begin
  TRequest.New.BaseURL('http://localhost:8888/users/1')
    .Accept('application/json')
    .Delete;
end;

🔒 Authentication

You can set credentials using the BasicAuthentication or Token method before making the first request:

begin
  Request.BasicAuthentication('username', 'password');
  Request.Token('bearer token');
end;

You can set it once and it will be used for every request.

📝 Samples

Two projects were developed within the examples folder:

  • client: Windows VCL application consuming a REST API developed in Node.js

To run the project, you need to install its dependencies (DataSet-Serialize). To install using Boss, open a terminal and type:

boss install

If you prefer, you can manually download the DataSet-Serialize and add it to Search Path.

To run the server you will need Node.js and NPM. With everything installed, open a terminal, install the dependencies and run the server:

npm install
node server.js

⚠️ License

RESTRequest4Delphi is free and open-source software licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].