diff --git a/vcr/matchers.py b/vcr/matchers.py index 57e7a02d..73492924 100644 --- a/vcr/matchers.py +++ b/vcr/matchers.py @@ -49,7 +49,8 @@ def _transform_json(body): # Request body is always a byte string, but json.loads() wants a text # string. RFC 7159 says the default encoding is UTF-8 (although UTF-16 # and UTF-32 are also allowed: hmmmmm). - return json.loads(body.decode('utf-8')) + if body: + return json.loads(body.decode('utf-8')) _xml_header_checker = _header_checker('text/xml')