Class: Fake::Request

Inherits:
Rack::Request
  • Object
show all
Defined in:
lib/fake/request.rb

Instance Method Summary collapse

Instance Method Details

#body_stringObject



13
14
15
# File 'lib/fake/request.rb', line 13

def body_string
  @body_string ||= body.gets
end

#POSTObject



4
5
6
7
8
9
10
11
# File 'lib/fake/request.rb', line 4

def POST
  params = super
  if content_type && content_type.downcase == 'application/json'
    hash = JSON.parse(body_string)
    params.merge!(hash)
  end
  params
end