#1 Re: mORMot 1 » REST Server in Delphi 5 » 2021-06-15 03:44:11

Thank you!

I tried to do something with THttpApiServer.SetAuthenticationSchemes() but I couldn´t. May be I didn´t understand how to do it.

I think I will try just to use parameters for username and password.

#2 Re: mORMot 1 » REST Server in Delphi 5 » 2021-06-14 01:28:54

Hello!

Almost one year ago, I asked some questions about making a small REST server with Delphi 5. You suggested to compile SynCrtSock and to take a look at the "09 - HttpApi web server" sample. I did that and could compile it. I also said that it was something I would have to do in the future. Well... the future arrived! :-)

Now I am trying to do this and I have a new doubt. I want to add authentication. I just want that when a user tries to access the server, he should have to indicate a user name and a password. I read the documentation but I can´t find how to do it using THttpApiServer and THttpServerRequest (the components used in sample 09).

Can you please tell me how can I do this? Thanks in advance!

#3 Re: mORMot 1 » REST Server in Delphi 5 » 2020-07-27 18:10:42

Yes, I know I will have to do a lot of JSON work by hand. But if this works it will be worth.

This is not something I have to do just now. When it comes the moment, I will see... :-)

Thanks again.

#4 Re: mORMot 1 » REST Server in Delphi 5 » 2020-07-24 00:27:23

Thank you very much for your answer. I tried "09 - HttpApi web server" sample,  I could compile it and it works!

I think I can manage with that to do what I need. I will try... Thank you very much again!

#5 mORMot 1 » REST Server in Delphi 5 » 2020-07-22 23:26:23

GustavoM
Replies: 8

First of all, sorry for my english. :-(

Second, congratulations for the excelent component you have! I read almost all of the documentation and it is clear that you LOVE what you did. Congratulations again!

And third...

I have an application in Delphi 5 and I need to make a small REST server. I don´t need to use any database components of mORMot. I just need to make something similar to the sample "06 - Remote JSON REST Service". May be a bit more complex, but that is the basic idea. Instead of the procedure TServiceServer.Sum, I can write my own procedures to obtain the results to GET commands.

The problem is... I couldn´t compile mORMot in Delphi 5. I tried with sample 06 and some others and it is impossible to compile. I always get errors. I changed some lines, commented some lines... and again errors. I know mORMot is guaranteed to work on Delphi 6 or newer, but I also know some components work also in Delphi 5 (like SynPDF).

I also tried compiling old releases of mORMot (2020-07-17, 1.18.4952, 1.18.2975, 2012-03-08).

So... the question is... is there a way to compile a simple REST server in Delphi 5? Thanks in advance!

Board footer

Powered by FluxBB