[Lazarus] HTTP client/server components committed.

Michael Van Canneyt michael at freepascal.org
Sun May 15 18:13:09 CEST 2011


Hi,

In the light of recent fppkg and fcl-web discussions:

I've committed simple HTTP server (threaded or not) and HTTP Client 
components to FCL-Web. They work using the fcl-net ssockets unit. 
(for which a fix has been committed as well). Both use blocking sockets.

The server component is integrated in the rest of fcl-web, 
the client is rather stand-alone.
Both are designed to be easily extensible.

There are examples of how to use both. The server example for 
instance allows files to be served and will properly report a 
404 when a file is not found.

To do this, I committed a fpmimetypes unit to fcl-base, so the 
server can correctly determine the mime type of a file.
It can read the contents of a mime.types file as found on unix.

if someone knows where this file can be found (or related information) 
on a Windows OS, please let me know.

This is an initial implementation. Known to-dos:
Client:
   * Maybe add proxy support ?
   * Easy access methods for POST/DELETE etc. commands.
     (currently only Get exists as a method, the rest can easily be done with HTTPMethod)

Server:
   * Create a TWebHandler and THTTPWebApplication for use as a Lazarus project.

Comments and suggestions welcome. Please report bugs in the bugtracker.

Michael.



More information about the Lazarus mailing list