You are not logged in.
Pages: 1
Thanks a lot.
Hello,
I feel lost with the authentication process. I tried all samples but couldn't figure out how to use authentication, with TSQlRestServerFullMemory.
My Server Code on start up (it's just a sample):
procedure TForm1.FormCreate(Sender: TObject);
begin
_tableModel := TSQLModel.Create([],'root');
_restServer := TMyRestServer.Create(_tableModel, true); //TSQlRestServerFullMemory
_server := TSQLHttpServer.Create('888', [_restServer], '+', HTTP_DEFAULT_MODE);
_server.AccessControlAllowOrigin := '*';
end;
TMyRestServer = class(TSQlRestServerFullMemory)
published
procedure Test(Ctxt: TSQLRestServerURIContext);
end;
procedure TMyRestServer.Test(Ctxt: TSQLRestServerURIContext);
begin
case Ctxt.Method of
mGET:
Ctxt.Returns('test');
end;
end;
Where do I specify, which users (with password) have permissions to log in and when the session expires? Actually, I want to load all the registered users from my database.
Furthermore, for the client I use SmartMobileStudio. I invoke my rest server directly with the REST class in SMS using the URI with all required parameters. What params do I need to send to the server as well, in order my rest call is accepted?
e.g.
REST['http://localhost:888/root/', 'test']
.OnDone(myOnDoneHandler)
.Param('filter', myFilter)
.Get;
Oh ... I just saw it is Ctxt.Call^.InBody.
Since I am using Lazarus, I have to use the pointer operator ^ to access its memebers, where Delphi has some compiler magic.
Hello,
I am using the TSQLRestServerFullMemory class to communicate with the client. I can resivce data from the server (GET), but don't know how I can access the input data (POST/PUT/DELETE), send by the client.
I have the following code:
TTableService = class(TSQLRestServerFullMemory)
published
procedure Article(Ctxt: TSQLRestServerURIContext);
end;
procedure TTableService.Article(Ctxt: TSQLRestServerURIContext);
begin
case Ctxt.Method of
mGET: Ctxt.Returns(TTblArticle.Read);
mPUT: ???;
mPOST: ???;
mDELETE: ???;
else
SetErrorMessage(Ctxt, Format(RS_ContextMethodNotSupported, [Ord(Ctxt.Method)]));
end;
end;
Thanks a lot. You saved my day
I have added all 3 pathes as mentioned in the documentation, but when I use the mormot unit, I get the error message: "Cannot open include file "Synopse.inc" in the mormot.pas file.
That file is present and that path is also in the project options. Any hint, why it cannot open that file?
Thanks!
Hello,
I am very new to lazarus, and don't know how to set the search and library path for the mORMot files. I read in the lazarzs forums, that I cannot set such pathes!?
So how to tell lazarus, where the files are located in order my project can find it?
thanks,
Markus
Do you mean, instead of using TSQLRecord and publishing that table, I shall implenent my own published method on a derived TSQlRestServerFullMemory like in the example: 06 - Remote JSON REST Service?
How to I implement the GET/PUT/POST/DELETE commants sent by the client, do perform ny own DB access?
I am very new to the whole concept of SOA and REST and mORMot and providing data to clients. Therefore, it's bit hard for me where I shall start.
Hello,
I actually just want to share my database data (firebird) over the internet using REST and JSON (Client: Android using Android Studio).
Using mORMot seems to make that task pretty easy. But I wonder, what happens when my tables are going to change in the future, and old clients want to access "altered" tables, which will change in future versions of the server?
E.g.:
Current table name on server: TABLE_V1 => the corresponding REST uri for the client would be: http://myserver.com/root/table_v1
Altered table name on server in the future: TABLE_V2 => The server is then listening on: http://myserver.com/root/table_v2
(Subsquently, the table name stays the same, but new columns are added or column names are changed)
So my question is:
How to prepare my server to be ready for such changes in the future? E.g. redirecting OLD client request from http://myserver.com/root/table_v1 to ../table_v2 and still returning old JSON format records (data)?
Thanks,
markus
Pages: 1