Sha256: 36c15a6c0aa4f3555c5ad351956dd3bc1d47b467e9660da98bdc449ff96f6db3
Contents?: true
Size: 801 Bytes
Versions: 2
Compression:
Stored size: 801 Bytes
Contents
===== Sumarry Rack convenience middleware for simplified handling of Accept header (env['HTTP_ACCEPT']). Allows ordering of its values (accepted media types) according to their "quality" (preference level). This wrapper is typically used to determine the request's prefered media type (see example below). ===== Install gem install mynyml-rack-accept-media-types --source=http://gems.github.com/ ===== Examples env['HTTP_ACCEPT'] #=> 'application/xml;q=0.8,text/html,text/plain;q=0.9' types = Rack::AcceptMediaTypes.new(env['HTTP_ACCEPT']) types #=> ['text/html', 'text/plain', 'application/xml'] types.prefered #=> 'text/html' ===== Links source:: http://github.com/mynyml/rack-accept-media-types rdocs:: http://docs.github.com/mynyml/rack-accept-media-types
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mynyml-rack-accept-media-types-0.5.1 | README |
mynyml-rack-accept-media-types-0.6 | README |