[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fastcgipp-users] REQUEST_URI environment variable?

From: Axel von Bertoldi
Subject: Re: [Fastcgipp-users] REQUEST_URI environment variable?
Date: Mon, 16 Nov 2009 09:34:04 -0700


As Eddie mentioned, the relevant info you're looking for is pathInfo. That's everything after the scriptName and before the query string. You can use that to create a restfull or rpc type of architecture. I have done that in one of my applications and it works very well.

As an implementation tip, you could try mapping each unique pathInfo to either a class or method to handle the request. For the former, std::map will be useful, for the later boost::function and boost::bind will be helpful (in addition to std::map).

Hope that helps.


On Sun, Nov 15, 2009 at 2:49 PM, Eddie Carle <address@hidden> wrote:
On Sat, 2009-11-14 at 17:55 +1030, address@hidden wrote:
> Not sure if these emails are making it through as they haven't hit the
> list yet (24hrs + since last two sent).
> Anyway, is it possible to make REQUEST_URI or even THE_REQUEST
> environment variables available in fastcgi++?
> In other words, is it possible and just not implemented or impossible
> because FastCGI and/or Lighttpd don't support it?
> The reason I ask is that although I want to rewrite all requests for
> files that don't physically exist under DOCROOT to one index.fcgi
> controller, I still need access to the original request to provide
> parameters to the controller ... and would rather avoid using Query
> String data or rewriting URLs  to query strings which would be a
> nightmare to maintain.
> What I'd really like to achieve is something like ZendFramework's
> Request parsing system.

We opted to include the individual components of the REQUEST_URI
environment variable. Best I recall this splits into scriptName,
pathInfo and queryString. The pathInfo member should have the
information you are looking for. Check out the echo example and throw
some extra path information onto it. Also
       Eddie Carle

reply via email to

[Prev in Thread] Current Thread [Next in Thread]