Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: REST Server call to not return in JSON Style?

Permlink Replies: 0 Threads: [ Previous | Next ]
steven chesser

Posts: 401
Registered: 4/13/09
REST Server call to not return in JSON Style?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 29, 2018 12:57 PM
Using Tokyo Update 2

I have a REST / Datasnap server running for almost 2 years, works very well.

Problem I have is I need to add a few "simple" calls that was asked of me but they DON'T want a JSON response. At all in the mix.

So if I had a function say

TInventory = class(TDSServerModule)
    procedure DSServerModuleCreate(Sender: TObject);
    procedure DSServerModuleDestroy(Sender: TObject);
    { Private declarations }
 Function GetTodaysData : String;
Function TInventory.GetTodaysData : String;
 result := 'Today is a good day to die';

then if the user tried this call, all they would get back is "Today is a good day to die"
nothing else.. no Result : { } , or anything... no translation of slashes to play happy with JSON.

I Guess basically , RAW data output. Whatever I pass out... is what the user will get.

Will be a bit more "complex" data ... but still just plain simple text shooting out.

And NO, I can not dictate what the other people involved should actually be requesting/doing... I get it.... but I don't make the calls... and they
are already doing such with another service for years, so I need to duplicate, and would love to have it all inside this stable running server app :)
These people don't use DELPHI / DATASNAP .... so they don't want all the over head, ect... just send a request, send back a simple text blast, and
their existing code "should" work.
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02