You are not logged in.
Pages: 1
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!
Offline
The REST server part never was Delphi 5 compatible.
Only the cross-platform client units can be used. So no REST server...
In practice, we are not able to support Delphi 5 any more.
The Delphi 5 compiler refuses to compile the mORMot trunk since a few months (some obscure internal errors), and we were not able to circumvent it...
You may try to compile SynCrtSock, and use its raw HTTP server classes...
Take a look at the "09 - HttpApi web server" sample.
Offline
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!
Offline
The good part is that if you use the http.sys API server of SynCrtSock, you will have a very proven and efficient Web Server on Windows, to expose your Delphi 5 application.
But a lot of JSON powerplate is to be done by hand...
Offline
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.
Offline
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!
Offline
You could handle basic authentication, over TLS/HTTPS for instance.
There is no built-in implementation of it in SynCrtSock for socket-based THttpServer: you have to implement the expected header with base-64 decoding to check the password.
But there is some built-in authentication via THttpApiServer.SetAuthenticationSchemes() in SynCrtSock.
Offline
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.
Offline
Pages: 1