Sha256: 2b8476ac71a2c25c4b9ab715aad8b7b3b29ee50f456970e82b0bf0957bf19d24
Contents?: true
Size: 708 Bytes
Versions: 6
Compression:
Stored size: 708 Bytes
Contents
module Plezi ##### # this is a Handler stub class for an HTTP echo server. 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.body.last << "\n\n params:" request.params.each {|k,v| response.body.last << "\n#{k}: #{v}"} response.send response.finish end # does nothing - a simple stub as required from handlers def add_route *args self end # does nothing - a simple stub as required from handlers def add_host *args self end end end
Version data entries
6 entries across 6 versions & 1 rubygems