.json() may fail, see http://docs.python-requests.org/en/latest/user/quickstart/#json-response-content.