Normalize ESP response and recipient status

This commit is contained in:
medmunds
2016-03-05 17:22:27 -08:00
parent 518e6e86f8
commit 3a93648481
5 changed files with 118 additions and 83 deletions

View File

@@ -74,10 +74,10 @@ class AnymailRequestsBackend(AnymailBaseBackend):
raise AnymailRequestsAPIError(email_message=message, payload=payload, response=response)
return response
def deserialize_response(self, response, payload, message):
"""Return parsed ESP API response
def deserialize_json_response(self, response, payload, message):
"""Deserialize an ESP API response that's in json.
Can raise AnymailRequestsAPIError if response is unparsable
Useful for implementing deserialize_response
"""
try:
return response.json()