Mixin module that provides the following:

  1. Access to the CGI environment variables as methods. See documentation to the CGI class for a list of these variables. The methods are exposed by removing the leading HTTP_ (if it exists) and downcasing the name. For example, auth_type will return the environment variable AUTH_TYPE, and accept will return the value for HTTP_ACCEPT.

  2. Access to cookies, including the cookies attribute.

  3. Access to parameters, including the params attribute, and overloading [] to perform parameter value lookup by key.

  4. The initialize_query method, for initializing the above mechanisms, handling multipart forms, and allowing the class to be used in “offline” mode.

Attributes
Read & Write

Get the cookies as a hash of cookie-name=>Cookie pairs.

Read

Get the parameters as a hash of name=>values pairs, where values is an Array.

Read

Get the uploaded files as a hash of name=>values pairs

Instance Methods

Get the value for the parameter with a given key.

If the parameter has multiple values, only the first will be retrieved; use params to get the array of values.

Returns true if a given query string parameter exists.

An alias for has_key?

A wrapper class to use a StringIO object as the body and switch to a TempFile when the passed threshold is passed. Initialize the data from the query.

Handles multipart forms (in particular, forms that involve file uploads). Reads query parameters in the @params field, and cookies into @cookies.

An alias for has_key?

Return all query parameter names as an array of String.

Returns whether the form contained multipart/form-data

Set all the parameters.

Get the raw cookies as a string.

Get the raw RFC2965 cookies as a string.

offline mode. read name=value pairs on standard input.

Parses multipart form elements according to

http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2

Returns a hash of multipart form parameters with bodies of type StringIO or Tempfile depending on whether the multipart form element exceeds 10 KB

params[name => body]