#1 2016-05-28 07:43:17

markus_ja
Member
Registered: 2015-11-20
Posts: 10

How to access PUT data in TSQLRestServerFullMemory class

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;

Offline

#2 2016-05-28 07:49:34

markus_ja
Member
Registered: 2015-11-20
Posts: 10

Re: How to access PUT data in TSQLRestServerFullMemory class

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.

Offline

Board footer

Powered by FluxBB