On this page
End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
CGI::QueryExtension
Mixin module that provides the following:
-
Access to the
CGIenvironment variables as methods. See documentation to theCGIclass for a list of these variables. The methods are exposed by removing the leadingHTTP_(if it exists) and downcasing the name. For example,auth_typewill return the environment variableAUTH_TYPE, andacceptwill return the value forHTTP_ACCEPT. -
Access to cookies, including the cookies attribute.
-
Access to parameters, including the params attribute, and overloading
[]to perform parameter value lookup by key. -
The
initialize_querymethod, for initializing the above mechanisms, handling multipart forms, and allowing the class to be used in “offline” mode.
Instance methods 12
Get the cookies as a hash of cookie-name=>Cookie pairs.
Get the uploaded files as a hash of name=>values pairs