import json


class Response(object):
    def __init__(self, status_code, body, headers=None):
        self.status_code = status_code
        self._body = body
        self._body_parsed = None
        self.content_type = headers['content-type'].split(';')[0]
        self.headers = headers

    @property
    def is_ok(self):
        return self.status_code == 200

    @property
    def payload(self):
        if self.content_type.startswith('application/json'):
            if not self._body_parsed:
                self._body_parsed = json.loads(self._body)

            return self._body_parsed
        else:
            return self._body

    @classmethod
    def from_request(cls, response):
        return Response(
            response.code,
            response.read(),
            response.headers,
        )

    @classmethod
    def from_http_error(cls, http_error):
        return Response(
            http_error.code,
            http_error.read(),
            http_error.headers,
        )

@@ -85,16 +85,32 @@
 ers=None
+, ok_status=None
 ):%0A     
@@ -298,16 +298,58 @@
  headers
+%0A        self.ok_status = ok_status or 200
 %0A%0A    @p
@@ -412,19 +412,30 @@
 code == 
-200
+self.ok_status
 %0A%0A    @p
@@ -757,16 +757,32 @@
 response
+, ok_status=None
 ):%0A     
@@ -879,32 +879,64 @@
 sponse.headers,%0A
+            ok_status=ok_status%0A
         )%0A%0A    @

Add configurable ok status code for Response