<h1>Interpreting Parameters</h1>

WebGate represents request parameters as a hash table with string keys and passes them to the resource handler as its last argument. However, some requests contain complex parameters with type and header information and any request parameter can occur multiple times with different values, hence WebGate doesn't use simple strings as values in the parameters table but rather lists of instances of the <tt>message</tt> structure that has a SRFI-99 definition similar to this one:

<verbatim>
  (define-record-type message
    #f #t
    type headers
    body)
</verbatim>

The <tt>type</tt> field holds the content type of the message, <tt>headers</tt> contains an association list of headers and <tt>body</tt> contains the actual payload data as a string.

To access textual data conveniently, there is a synthetic accessor <tt>message-text</tt> that returns the message body iff it has a content type.

The helpers <tt>parameter-list-ref</tt> and <tt>parameter-ref</tt> allow you to extract a list of parameter values or a single value from a hash table. They take the hash table, a string key and an optional converter from message records to the desired target type as arguments. The message converter defaults to <tt>message-text</tt>.