#1 2014-06-26 15:22:10

ael
Member
Registered: 2014-03-18
Posts: 5

Accessing TSQLRestServerURIContext content

Hello,

I'm using published methods on the server and get a TSQLRestServerURIContext with the client request.

It's very easy to access parameters through the InputDouble[], ... but I cannot figure out how to access the body (which is JSON data) if the method is POST/PUT.

Is there a way to easily access this data (I wish to deserialize the body into a class) or should I unserialize manually?

Offline

#2 2014-06-26 20:21:06

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

Re: Accessing TSQLRestServerURIContext content

Just use ServiceContext.Request.Call^.InBody property.
smile

In fact, the TSQLRestServerURIContext.Call is a pointer to the low-level HTTP structure for input and output of the request.

Offline

#3 2014-06-27 09:37:03

ael
Member
Registered: 2014-03-18
Posts: 5

Re: Accessing TSQLRestServerURIContext content

Thanks a lot! I used this structure with a TDocVariantData.InitJSON and it works beautifully.

Offline

Board footer

Powered by FluxBB