Class: Sinatra::Request

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

Overview

The request object. See Rack::Request for more info: rack.rubyforge.org/doc/classes/Rack/Request.html

Instance Method Summary collapse

Instance Method Details

#acceptObject



17
18
19
# File 'lib/sinatra/base.rb', line 17

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

#paramsObject

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



22
23
24
25
26
# File 'lib/sinatra/base.rb', line 22

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

#user_agentObject



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

def user_agent
  @env['HTTP_USER_AGENT']
end