| Class | Sinatra::EventContext |
| In: |
lib/sinatra/context.rb
|
| Parent: | Object |
| request | [R] |
Sets or returns response headers
Usage
header 'Content-Type' => 'text/html' header 'Foo' => 'Bar'
or
headers 'Content-Type' => 'text/html',
'Foo' => 'Bar'
Whatever blows your hair back
# File lib/sinatra/context.rb, line 58
58: def headers(value = nil)
59: @headers.merge!(value) if value
60: @headers
61: end
Redirect to a url
# File lib/sinatra/context.rb, line 75
75: def redirect(path)
76: logger.info "Redirecting to: #{path}"
77: status 302
78: header 'Location' => path
79: end