[fpc-pascal] fpweb: processing URLs like GET http://server/cgi-bin/tigercgi/documents/301/

Michael Van Canneyt michael at freepascal.org
Mon Feb 25 13:38:28 CET 2013

On Mon, 25 Feb 2013, Reinier Olislagers wrote:

> Hi all,
> Hoping you fpweb gurus know the answer by heart:
> Say I have an fpweb CGI server with action documents registered and I
> GET http://server/cgi-bin/tigercgi/documents/301/
> 1. How do instruct the documents action to handle that? Currently I get
> a Error: Could not determine HTTP module for request ....

Did you register the module ? 
It means that the documents module was not found.

As soon as the path has more than 1 component, it is assumed that the path is composed of
If - and only if - there is only 1 path component, it is assumed to be an action:
There are is a flag to change this latter behaviour, so it is assumed to be a module:

> 2. Is there some example/easy way of recognizing the part after the
> module or do I have to parse the URI property in some way?
> Seem like GetNextPathInfo may be a likely candidate?


> 3. For any URL, I would like to differentiate between e.g. GET and PUT.
> How do I figure out which method (GET, POST, PUT, DELETE...)was used?

See Request.Method.


More information about the fpc-pascal mailing list