mirror of
https://github.com/lloeki/nanoserve.git
synced 2025-12-06 11:14:40 +01:00
Implement request body and normalized headers access
This commit is contained in:
parent
dc8739c692
commit
dd5001cb7c
1 changed files with 8 additions and 0 deletions
|
|
@ -102,6 +102,14 @@ module NanoServe
|
||||||
Hash[*@uri.query.split('&').map { |kv| kv.split('=') }.flatten]
|
Hash[*@uri.query.split('&').map { |kv| kv.split('=') }.flatten]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def body
|
||||||
|
@body
|
||||||
|
end
|
||||||
|
|
||||||
|
def [](key)
|
||||||
|
@headers[key.downcase]
|
||||||
|
end
|
||||||
|
|
||||||
def <<(line)
|
def <<(line)
|
||||||
if @method.nil?
|
if @method.nil?
|
||||||
parse_request(line.chomp)
|
parse_request(line.chomp)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue