Skip to content

Instantly share code, notes, and snippets.

@farnetani
Created March 4, 2017 05:08
Show Gist options
  • Save farnetani/383fb3e2d82dc8f295559518bb32fdd8 to your computer and use it in GitHub Desktop.
Save farnetani/383fb3e2d82dc8f295559518bb32fdd8 to your computer and use it in GitHub Desktop.
Como ajustar o ContentType e charset no datasnap restful
procedure TWebModule1.WebModuleBeforeDispatch(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
Response.ContentType := 'text/html; charset=utf-8';
Response.ContentEncoding := 'utf-8';
if FServerFunctionInvokerAction <> nil then
FServerFunctionInvokerAction.Enabled := AllowServerFunctionInvoker;
end;
//NO CASO substituir text/html; para json...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment