body helper method.
get '/foo' do body "bar" end after do puts body endIt is also possible to pass a block to
body, which will be executed
by the Rack handler (this can be used to implement streaming).
body, you can also set the status code and headers:
get '/foo' do
status 418
headers \
"Allow" => "BREW, POST, GET, PROPFIND, WHEN",
"Refresh" => "Refresh: 20; http://www.ietf.org/rfc/rfc2324.txt"
body "I'm a tea pot!"
end
body, headers and status with no arguments
can be used to access their current values.
Casiano Rodriguez León 2015-01-07