public
Description: Rack convenience middleware for simplified handling of Accept header.
Homepage:
Clone URL: git://github.com/mynyml/rack-accept-media-types.git
name age message
file .gitignore Sat Nov 21 08:47:44 -0800 2009 v0.9 [mynyml]
file LICENSE Fri Jun 05 13:28:35 -0700 2009 Initial commit [mynyml]
file Manifest Sat Nov 21 07:47:52 -0800 2009 Simplify gem handling [mynyml]
file README Sat Nov 21 08:43:09 -0800 2009 Integrate with Rack::Request request = Rack::R... [mynyml]
file Rakefile Sat Nov 21 07:47:52 -0800 2009 Simplify gem handling [mynyml]
file examples.rb Mon Jun 08 10:09:38 -0700 2009 Update examples file. [mynyml]
directory lib/ Sat Nov 21 08:43:09 -0800 2009 Integrate with Rack::Request request = Rack::R... [mynyml]
file rack-accept-media-types.gemspec Sat Nov 21 08:47:44 -0800 2009 v0.9 [mynyml]
file specs.watchr Sat Nov 21 07:47:52 -0800 2009 Simplify gem handling [mynyml]
directory test/ Sat Nov 21 08:43:09 -0800 2009 Integrate with Rack::Request request = Rack::R... [mynyml]
README
===== 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 rack-accept-media-types --source http://gemcutter.org

===== Examples

  env['HTTP_ACCEPT']  #=> 'application/xml;q=0.8,text/html,text/plain;q=0.9'

  req = Rack::Request.new(env)
  req.accept_media_types          #=> ['text/html', 'text/plain', 'application/xml']
  req.accept_media_types.prefered #=>  'text/html'

===== Links

source:: http://github.com/mynyml/rack-accept-media-types
rdocs::  http://docs.github.com/mynyml/rack-accept-media-types