Skip to content

v5.22.0

Latest

Choose a tag to compare

@omarryhan omarryhan released this 02 Dec 20:46

What's Changed

  • Return empty JSON bodies from Response.content instead of falling back to data (#177, fixes #166) — @Kulraj69

Response.content now returns the parsed JSON whenever the body is valid JSON, even if it's falsy ([], {}, 0, false, ""). Before, these came back as None. For example, downloading a file containing [] with alt="media" returned None. Note that calls whose response body is {}, such as many delete methods, now return {} instead of None. If your code checks the result with is None, check for falsiness instead (if not res:).

Full Changelog: v5.21.0...v5.22.0