'Close the wrapped response if possible.  You can also use the object
in a with statement which will automatically close it.
.. versionadded:: 0.9
Can now be used in a with statement.'

def close(self):

    if hasattr(self.response, 'close'):
        self.response.close()
    for func in self._on_close:
        func()
