Hi Tomas,

> if I use 'allowed' in my web application, PicoLisp will assign
> variables from QUERY_STRING (if called via GET HTTP method) or the
> message body (if POST used).

To be precise: This is independent of 'allowed' and '*Allow' (these just
inhibit illegal access to the server).


> What if I do not want the variables to
> be assigned and just want to get an assoc list of these keys/values
> instead?

This is hard-coded into the server. You could redefine the internal
function '_htSet', which receives the variables and values and does the
above assignment (as you probably know as you refer to "*HtSet" below).

Redefining '_htSet' from the outside (by simply calling (undef '_htSet),
followed by (de _htSet (..) ..)) might not work, because then the
transient symbol "http" (which is used in the 'throw') cannot be
accessed. So it might be necessary to path '_htSet' on the fly.

Another possibility is to use a separate set of reserved variables, and
build the association list from their values.


Why do you not want these variables be assigned? Using such global
variables is the simplest and most efficient solution in most cases. I
do not see a problem with it, as you can control which variables are
used, and thus avoid possible conflicts.


> Also, is it possible to combine these cases in one
> application, e.g. having different behaviour for different url
> handlers?

If you have a routine for modifying '_htSet', you could call it in the
beginning of some applications, and not call it in others.


> What does "*HtSet" do, what is it for and how is it supposed
> to be used?

The http server handles variables of the form '*Foo(X)' such that it
puts the value into an association list in the variable '*Foo', using
the key 'X'. This is, for example, used heavily in "lib/form.l" for the
'*Gui(N)' components.

"*HtSet" contains a list of all such variables, and is used to clear the
assoc list when that variable appears for the first time, to avoid
adding new values to possibly old ones (remained from a previous
request).

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

Reply via email to