Class Rack::MediaType
In: lib/sinatra/rack_accept.rb
Parent: Sinatra::Base

Methods

call  

Included Modules

Rack::RespondTo::Helpers

Constants

ACCEPTED_MEDIA_TYPES = { :xml => { :return => 'application/xml', :match => ['application/xml', 'text/xml'] }, :json => { :return => 'application/json', :match => ['application/json'] }, :html => { :return => 'text/html', :match => ['application/xhtml+xml', 'text/html', '*/*'] }, :png => { :return => 'image/png', :match => ['image/png'] }, :gv => { :return => 'application/ghostscript', :match => ['application/ghostscript'] }   Define supported media types here The :return key stands for content-type which will be returned The :match key stands for the matching Accept header

Public Instance methods

[Validate]