
Introduction
A while back I wrote a component for exposing FireDAC tables as REST endpoints in Delphi. I wasn’t entirely happy with the component that I’d written, however, it was really intended as a proof of concept. I was quite surprised to learn that people were actually making use of that component, rather than simply using it as an example of what could be done.
Fast-Forward a couple of years, and I found myself needing precisely that component in another project. I wasn’t going to make use of my proof-of-concept code, knowing it to have some flaws, and so I decided to have a do-over. Today, I’d like to introduce you to the deREST components: https://github.com/chapmanworld/deRest
deREST
The deREST components are my replacement for the older component which was named JCRUD.
As with the original component, I still maintain my disclaimer: “I will not be held responsible for any damages that occur due to the use or misuse of this component.”, however, unlike the original component I do intend to maintain deREST going forwards.
In the video below, I explain more about the component set, my intentions regarding maintenance, and how to make use of it. I also give a few hints as to my intended road-map for deREST.
(Apologies for the video being a little choppy in places, just where I edit out some gafs…)
deREST is licensed MIT https://github.com/chapmanworld/deRest/blob/master/LICENSE
Conclusion
I hope these components are useful to you.
Feel free to get in touch with suggestions for improvement!
Thanks for Reading / Watching!







How can I change the configuration of the deResft api to work with the Zeoslib library because I am limited with firedac by driver and the version of delphi that I have.
I’m not familiar with Zeoslib.
deRest depends on the TFDConnection and TFDQuery classes, if you’re able to query your data using these, then deREST will work with it.
I believe Delphi Professional edition does include these classes, though connectors for remote databases is limited – it would help to know which DBMS you’re connecting to.
Dear Craig,
I have download the latest for it at github. In 32bit Platform it can build and install well. but in 64bit Platform it could not build. the error message show statement like these
[dcc64 Error] pkg_deREST.dpk(39): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST’
[dcc64 Error] pkg_deREST.dpk(40): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.filterparser’
[dcc64 Error] pkg_deREST.dpk(41): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.restfilter.standard’
[dcc64 Error] pkg_deREST.dpk(42): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.restresponse.standard’
[dcc64 Error] pkg_deREST.dpk(43): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.restarray.standard’
[dcc64 Error] pkg_deREST.dpk(44): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.restobject.standard’
[dcc64 Error] pkg_deREST.dpk(45): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.pathinfo’
[dcc64 Error] pkg_deREST.dpk(46): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.types’
[dcc64 Error] pkg_deREST.dpk(47): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.api’
[dcc64 Error] pkg_deREST.dpk(48): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.producer’
[dcc64 Error] pkg_deREST.dpk(49): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.authenticator’
[dcc64 Error] pkg_deREST.dpk(50): E2200 Package ‘pkg_deREST’ already contains unit ‘deREST.passthrough’
Interesting, which version of Delphi are you using to build it?
I’ve not looked at the package in a while and I know we’ve had a release since, it may need some updates. (I’ll take a look today/tomorrow and update here.)
Dear Chapman,
I am using Delphi 10.2.1
Dear Chapman…Is this support for Delphi 10.3 Rio?
Honestly, I’ve not tested it in Rio yet, but it should work just fine.
Craig – as ever you take REST development forward in leaps and bounds. Im going to share this in the UK dev group. Perhaps Jason can get you along to a meeting to talk to us troops . Cheers and thanks. Pete
I am running tests and realized that the result is normally presented in the browser, however, in RESTDEBUGGER and DELHI does not return error and neither brings results and some tables that I am testing, I use FIREBIRD.
in deREST.api alter line 1158 from Response.ContentType := ‘application\json”‘; to Response.ContentType := ‘application\json; charset=”UTF-8″‘; and line 1164 from Response.ContentType := ‘text\plain”‘; to Response.ContentType := ‘text\plain; charset=”UTF-8″‘;
Thanks for the edits – I’ll make and test the changes.
I’ll raise a GitHub issue to track the changes shortly.