lib/cassette-rack/request.rb in cassette-rack-0.7.0 vs lib/cassette-rack/request.rb in cassette-rack-0.8.0
- old
+ new
@@ -7,15 +7,15 @@
def get(path, params={}, headers={})
request(:get, path, params, headers)
end
- def post(path, body, headers={})
+ def post(path, body={}, headers={})
request(:post, path, {}, headers, body)
end
- def patch(path, body, headers={})
+ def patch(path, body={}, headers={})
request(:patch, path, {}, headers, body)
end
def put(path, body={}, headers={})
request(:put, path, {}, headers, body)
@@ -49,10 +49,10 @@
def response
@response
end
def parse_content(body, req)
- if req.headers['content-type'] == 'application/json' and body.class == Hash
+ if req.headers['content-type'] == 'application/json' and body.is_a?(Hash)
body.to_json
else
body
end
end