Fix handling responses without body

When a request isn't successful the response doesn't (may not?) contain
a body.  The previous code caused an AttributeError in such cases by
accessing the 'body' attribute even in such cases.  This commit fixes
the issue by accessing the 'content' attribute.

It also changes the logic to only log the response's content at the
debug level.