#1 2021-03-28 16:15:27

damiand
Member
From: Greece
Registered: 2018-09-21
Posts: 94

POST requests in method based services?

As far as I've read in the documentation, post method requests are not supported in method based services. Am I correct?

Last edited by damiand (2021-03-28 18:18:15)

Offline

#2 2021-03-28 22:09:22

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: POST requests in method based services?

Yes, is suported.

Example of how get post content as json

procedure TMBService.MyPostRequest(Ctxt: TSQLRestServerURIContext);
var j: variant;
begin
  if (Ctxt.Method = mPOST) and (Ctxt.Call^.InBodyTypeIsJson(True)) then
    j := _JsonFast(Ctxt.Call^.InBody);   
end;

Offline

#3 2021-03-29 09:03:47

damiand
Member
From: Greece
Registered: 2018-09-21
Posts: 94

Re: POST requests in method based services?

Thanks a lot! smile

Offline

Board footer

Powered by FluxBB