Delphi Datasnap:如何在delphi 10.3.2中将原始数据发送到Web REST客户端?

问题描述 投票:0回答:1

[当我使用Delphi XE8时,我使用以下代码将文本或图像发送到浏览器,而没有JSON值。此代码不再起作用:

服务器代码:

function TTest.GetText: TStream
begin
  result := TStringStream.create('test');
end

对于此示例,URL为http://localhost:8080/datasnap/rest/TTest/GetText

使用XE8,结果是:

test

对于10.3.2,结果为:

{"result":[[116,101,115,116]]}

如何禁用JSON结果格式?

谢谢您的帮助!

JP

delphi datasnap
1个回答
0
投票

使用参数json=false

http://localhost:8080/datasnap/rest/TTest/GetText?json=false

font:

http://docwiki.embarcadero.com/RADStudio/Rio/en/DBX_Parameter_Caching
© www.soinside.com 2019 - 2024. All rights reserved.