res = Response.new res.status #=> '200 OK' res.status = HTTP::STATUS_NOT_FOUND res.add_header('Content-Type', 'text/plain') res.body = 'test' puts res =< same thing # response construction res = Response.new(:status => HTTP::STATUS_NOT_FOUND, :content_type => 'text/plain', :body => 'test') # redirection res = Response.redirect(url, permanent = true/false) # serving static files res = Response.from_file(path, :directory_listing => true) # serving templates res = Response.from_template(path, binding) res = Response.streaming(:content_type => 'text/plain', :body => '', :rate => 1) do unless timed_out? send_data("#{Time.now}: hello there!") end end # headers res.add_header('Content-Type', 'text/plain') res.content_type = 'text/plain' # through method_missing # cookies res.set_cookie(:skey, '1235dfavbc5331', :path => '/', :domain => 'reality-scada.net', :ttl => 32330) res.set_cookie(:skey, '1233142344', :expires => Time.now + 300) res.delete_cookie(:skey) res.validate_cache(req, )