The media types of the HTTP_ACCEPT header ordered according to their "quality" (preference level), without any media type parameters.
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'
For more information, see:
Acept header: www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
Quality values: www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.9
ordered list of accept header's media types |
# File lib/sinatra/accept_media_types.rb, line 47 def accept_media_types @accept_media_types ||= Rack::AcceptMediaTypes.new(@env['HTTP_ACCEPT']) end
Generated with the Darkfish Rdoc Generator 2.