1
I have a project made from the WebBroker REST
, running as a service, I need to change the Cotent-Type
for 'application/json'
and by default the WebBroker REST
brings me as a result of
Content-Type 'text/html; charset=ISO-8859-1'
I change the answer by accessing the method
Getinvocationmetadata(True). Responsecontenttype = 'application/json'
class Data.DBXPlatform
, but it still doesn’t solve it adds one more Content-Type
just below the current.
This only happens in WebBroker REST
, if I create a project by DataSnap Server
I can normally. But I need the WebBroker REST
to access the information the client sends me.
Example of how to make the problem occur.
- Create a project from the Datasnap REST Application
In the Servermethods class, do in the same template.
uses System.StrUtils, Data.DBXPlatform;
function TServerMethods1.EchoString(Value: string): string;
begin
Result := Value;
GetInvocationMetadata.ResponseContentType := 'application/json';
end;
With this we tense the following Header response.
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Content-Length: 25% All Stories
Date: Tue, 10 Sep 2013 16:41:37 GMT
Pragma: dssession=542354.126073.592372,dssessionexpires=1200000
Content-Type: application/json