Features | Detailed Description
The Simple HTTP Server is a component from the Clever Internet Suite library.
SimpleHttpServer works in the same thread as the main application thread runs. You can use it for accepting requests from clients and sending the corresponding responses.
Available in VCL edition.
- Accept requests and send responses in the same application thread
- Easy-to-use intuitive interface
- Cookies support
- UTF-8 support
- Free one year upgrades and support
In only a few lines of source code, you can create a single-threaded Web server, accept requests and send responses.
// [Delphi] port := simpleServer.Listen(80); simpleServer.AcceptRequest(httpRequest);
if (simpleServer.RequestMethod = 'POST') and (simpleServer.RequestHeader.ContentType = 'application/x-www-form-urlencoded') then begin simpleServer.ResponseVersion := hvHttp1_1; simpleServer.ResponseHeader.ContentType := 'application/json'; simpleServer.KeepConnection := True;
name := httpRequest.FormFields['name'].FieldValue simpleServer.SendResponse(200, 'OK', '{"your_name": "' + name + '"}'); end else begin simpleServer.ResponseVersion := hvHttp1_1; simpleServer.ResponseHeader.ContentType := 'text/html'; simpleServer.KeepConnection := True;
simpleServer.SendResponse(200, 'OK', '<html><body>hello</body></html>'); end; |
When Purchasing the Clever Internet Suite you receive the full sources for all suite components and also free unlimited support.
|