#1 2021-09-06 11:57:38

mongkey
Member
Registered: 2021-08-26
Posts: 17

Is it possible doing crud via curl/common httpclient on mormot orm?

Thank you. Ex -> flutter as front end.

Last edited by mongkey (2021-09-06 12:20:18)

Offline

#2 2021-09-06 15:58:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

Yes, see the doc about the ORM layer REST URIs.

But I won't use it for anything but debugging or local access, because it may be unsafe to publish the whole ORM tables to the clients.
It is always better to publish SOA dedicated services.

Offline

#3 2021-09-06 22:15:24

mongkey
Member
Registered: 2021-08-26
Posts: 17

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

Ok,

Offline

#4 2021-09-07 09:32:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

Just one last hint: don't forget to include an "User-Agent" header in your flutter front end requests, otherwise the server may consider the client is a mORMot client, and then the returned JSON may be in "extended" format with unquoted field names, so Flutter is likely to have troubles parsing it.

Offline

#5 2021-09-07 18:57:17

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

As far as I understand,  mORMot "extended" format is compartible with json5, and json5 parsers exists in JS and Dart...

Last edited by mpv (2021-09-07 18:58:29)

Offline

#6 2021-09-07 23:34:52

mongkey
Member
Registered: 2021-08-26
Posts: 17

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

Actually i am nubie for this field, is it soa dedicated service = interface based client with security layer inside mormot? Or there is any article for soa dedicated service in mormot? I know mormot has fast speed with very small effort for pascal users.

If i use httpclient from flutter, is it posibble to set user auth just like from mormot unit? Or only secure it using jwt only.

Last edited by mongkey (2021-09-08 01:54:07)

Offline

#7 2021-09-08 05:56:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

Yes, I meant interface-based services.

For auth and a non-mORMot client, you may use a JWT.
But some user reported using Dart/Flutter https://synopse.info/forum/viewtopic.ph … 478#p35478

Never forget to secure the line over HTTPS.

Offline

#8 2021-09-08 06:43:35

mongkey
Member
Registered: 2021-08-26
Posts: 17

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

Ok, i'll try

Offline

#9 2021-09-09 04:14:09

mongkey
Member
Registered: 2021-08-26
Posts: 17

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

All work for now on LAMW, flutter, need dig deeper on mormot security, thank you AB!

Offline

#10 2021-09-09 07:02:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Is it possible doing crud via curl/common httpclient on mormot orm?

Great!

The main security requirement is to use HTTPS to hide the communication.
Then the requests are signed individually.

Offline

Board footer

Powered by FluxBB