Class: WEBrick::HTTPRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/hanoi/webrick.rb

Instance Method Summary collapse

Instance Method Details

#to_jsonObject



30
31
32
33
34
35
# File 'lib/hanoi/webrick.rb', line 30

def to_json
  headers = []
  each { |k, v| headers.push "#{k.inspect}: #{v.inspect}" }
  headers = "{" << headers.join(', ') << "}"
  %({ "headers": #{headers}, "body": #{body.inspect}, "method": #{request_method.inspect} })
end