Created
March 4, 2017 05:08
-
-
Save farnetani/383fb3e2d82dc8f295559518bb32fdd8 to your computer and use it in GitHub Desktop.
Como ajustar o ContentType e charset no datasnap restful
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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