I am working on a project in which I have to implement a simple web server to display a welcome page. So I put TTCPServer in my form, and I can successfully send plain text to a browser that interacts with the server. But how can I send HTML?
I tried this but did not work.
ClientSocket.Sendln('HTTP/1.0 200 OK');
ClientSocket.Sendln('MIME-version: 1.0');
ClientSocket.Sendln('Content-type: text/html');
ClientSocket.Sendln('Content-Length:'+IntToStr(Length(webpage)+10));
ClientSocket.Sendln(AnsiString(Format(webpage, [va, ma, mi, timexx])));
Any ideas? In any case, I do not want to use another component.
source
share