def METHOD_NAME(self, response):
    if 200 <= response.code < 300:
        d = defer.succeed((response.code, "OK"))
    else:
        # Go through the horrifying process of getting the response body
        # out of Twisted's plumbing.
        d = defer.Deferred()
        response.deliverBody(SimpleResponseReceiver(response.code, d))
    return d