lib/plezi/handlers/http_echo.rb in plezi-0.7.5 vs lib/plezi/handlers/http_echo.rb in plezi-0.7.6
- old
+ new
@@ -4,10 +4,10 @@
module HTTPEcho
module_function
# handles requests by printing out the parsed data. gets the `request` parameter from the HTTP protocol.
def on_request request
- response = HTTPResponse.new request, 200, {"content-type" => "text/plain"}, ["parsed as:\r\n", request.to_s]
+ response = HTTPResponse.new request, 200, {'content-type' => 'text/plain'}, ["parsed as:\r\n", request.to_s]
response.body.last << "\n\n params:"
request.params.each {|k,v| response.body.last << "\n#{k}: #{v}"}
response.send
response.finish
end