Class: Sinatra::Request

Inherits:
Rack::Request
  • Object
show all
Defined in:
lib/sinatra/base.rb

Instance Method Summary collapse

Instance Method Details

#acceptObject



14
15
16
# File 'lib/sinatra/base.rb', line 14

def accept
  @env['HTTP_ACCEPT'].split(',').map { |a| a.strip }
end

#paramsObject

Override Rack 0.9.x’s #params implementation (see #72 in lighthouse)



19
20
21
22
23
# File 'lib/sinatra/base.rb', line 19

def params
  self.GET.update(self.POST)
rescue EOFError => boom
  self.GET
end

#user_agentObject



10
11
12
# File 'lib/sinatra/base.rb', line 10

def user_agent
  @env['HTTP_USER_AGENT']
end