Class: Sinatra::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Sinatra::Request
- 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
- #accept ⇒ Object
-
#params ⇒ Object
Override Rack 0.9.x’s #params implementation (see #72 in lighthouse).
- #user_agent ⇒ Object
Instance Method Details
#accept ⇒ Object
17 18 19 |
# File 'lib/sinatra/base.rb', line 17 def accept @env['HTTP_ACCEPT'].to_s.split(',').map { |a| a.strip } end |
#params ⇒ Object
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_agent ⇒ Object
13 14 15 |
# File 'lib/sinatra/base.rb', line 13 def user_agent @env['HTTP_USER_AGENT'] end |