Lazarus

Programming => Networking and Web Programming => Topic started by: Donoss on June 15, 2020, 09:08:06 pm

Title: Building a REST API - REST Dataware
Post by: Donoss on June 15, 2020, 09:08:06 pm
Hi,

I'm trying to find the best tools to build a simple REST API using JSON and persisting it to a database.  I've looked all over but as a newbie I'm struggling to get started.  I've looked at REST Dataware but when I try to build a simple module I get an issue 'Can't find unit udmservice'.

I wanted to look at SQLDBRESTBridge but can't find the package to get it loaded, so any pointers will be really appreciated.

I also looked at Brook, lots of documentation but I'm new to this so got lost easily.

I also tried Mormot but can't get the packages loaded either direct or using the online package manager.

Any pointer to an easy example or component set for a very simple REST API will be much appreciated.

Many thanks

Andy
Title: Re: Building a REST API - REST Dataware
Post by: simone on June 15, 2020, 09:31:27 pm
Here you can find two very introductory examples:

http://lazplanet.blogspot.com/2019/03/basic-rest-api-implementation.html

https://medium.com/@marcusfernstrm/create-rest-apis-with-freepascal-441e4aa447b7

I hope they can be useful to you.
Title: Re: Building a REST API - REST Dataware
Post by: PascalDragon on June 16, 2020, 10:18:29 am
I wanted to look at SQLDBRESTBridge but can't find the package to get it loaded, so any pointers will be really appreciated.

You need FPC 3.2.0 or newer for that. You can use the RC1 (https://forum.lazarus.freepascal.org/index.php/topic,49110.0.html) for this.
Title: Re: Building a REST API - REST Dataware
Post by: Donoss on June 16, 2020, 02:51:00 pm
Hi everyone thanks for the info.

PascalDragon I assume you mean't 3.0.2 above for FPC?   Also the link doesn't appear to work, does it take you to the FPC download page?

Thanks

Andy
Title: Re: Building a REST API - REST Dataware
Post by: PascalDragon on June 16, 2020, 03:29:59 pm
PascalDragon I assume you mean't 3.0.2 above for FPC?   Also the link doesn't appear to work, does it take you to the FPC download page?

No, I meant 3.2.0, the upcoming release which is currently being finished and for which a release candidate is provided on the linked page (and the link works for me, but just in case: you need to go to the "Announcements -> Free Pascal" subforum at the top of the forum lists and then there is the thread "FPC 3.2.0rc1 released!"; the first post contains links to the downloads).
Title: Re: Building a REST API - REST Dataware
Post by: Donoss on June 21, 2020, 11:35:38 am
Thanks @PascalDragon got it ....
Title: Re: Building a REST API - REST Dataware
Post by: PascalDragon on June 21, 2020, 02:36:59 pm
And by now the final release is available as well. ;)
Title: Re: Building a REST API - REST Dataware
Post by: wisheskernel on September 22, 2020, 12:14:07 pm
My environment: Windows7 64bit, FPC 3.0.4, Lazarus 2.0.0  x86_64 and
I got the Compile error : Can't determine which overloaded function to call , at

Code: Pascal  [Select][+][-]
  1. DWClientREST1.Get;  //DWClientREST1: TDWClientREST;

Any help is going to be appreciated.
Title: Re: Building a REST API - REST Dataware
Post by: nummer8 on September 22, 2020, 01:00:43 pm
Marcus Fernstrom posted two example video's on youtube

Create REST APIs in FreePascal & Lazarus
https://www.youtube.com/watch?v=9N0cxI1Hp0U

Create REST APIs in FreePascal & Lazarus (with zoom)
https://www.youtube.com/watch?v=rEqVnwE8_Us
TinyPortal © 2005-2018