#1 2015-07-22 08:50:44

firstfriday
Member
Registered: 2015-07-21
Posts: 26

Returning HTML

This is probably easy but this code keeps returning

Content-Type=text/plain; charset=UTF-8

instead of

Content-Type=text/html; charset=UTF-8

procedure TSQLRestServerFullMemory.Help(Ctxt: TSQLRestServerURIContext);
begin
Ctxt.Returns('<html><body>Help</body></html>',HTML_SUCCESS,HTML_CONTENT_TYPE);
end;

Please help
Edgar

Offline

#2 2015-07-24 10:16:58

firstfriday
Member
Registered: 2015-07-21
Posts: 26

Re: Returning HTML

Hallo!
Can anybody help me in this matter?
How can I send content-Type HTML instead of PLAIN TEXT?
Thank you

Offline

#3 2015-07-24 10:56:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,663
Website

Re: Returning HTML

Why not just put the expected value in the parameter?

It expects an HTML header, not an HTML type:

  Ctxt.Returns('<html><body>Help</body></html>',HTML_SUCCESS,HTML_CONTENT_TYPE_HEADER);

Offline

#4 2015-07-26 10:30:46

firstfriday
Member
Registered: 2015-07-21
Posts: 26

Re: Returning HTML

uuuuhh, a copy past error, thanks

Offline

Board footer

Powered by FluxBB