Module | Rack::Utils
In: | lib/rack/utils.rb lib/rack.rb

Rack::Utils contains a grab-bag of useful methods for writing web applications adopted from all kinds of Ruby libraries.

### Methods

escape escape_path parse_query unescape unescape

### Classes and Modules

Module Rack::Utils::OkJson
Class Rack::Utils::InvalidParameterError
Class Rack::Utils::ParameterTypeError

### Constants

DEFAULT_SEP | = | /[&;] */n

### Attributes

key_space_limit | [RW] |
multipart_part_limit | [RW] |

### Public Instance methods

escape(s)

URI escapes. (CGI style space to +)

escape_path(s)

Like URI escaping, but with %20 instead of +. Strictly speaking this is true URI escaping.

parse_query(qs, d = nil, &unescaper)

Stolen from Mongrel, with some small modifications: Parses a query string by breaking it up at the ’&’ and ’;’ characters. You can also use this to parse cookies by changing the characters used in the second parameter (which defaults to ’&;’).

unescape(s, encoding = nil)
unescape(s, encoding = Encoding::UTF_8)

[Validate]