def readBody(response):
 def cancel(deferred):
  '\n        Cancel a L{readBody} call, close the connection to the HTTP server\n        immediately, if it is still open.\n\n        @param deferred: The cancelled L{defer.Deferred}.\n        '
  abort = getAbort()
  if (abort is not None):
   abort()
 d = defer.Deferred(cancel)
 protocol = _ReadBodyProtocol(response.code, response.phrase, d)
 def getAbort():
  return getattr(protocol.transport, 'abortConnection', None)
 response.deliverBody(protocol)
 if ((protocol.transport is not None) and (getAbort() is None)):
  warnings.warn('Using readBody with a transport that does not have an abortConnection method', category=DeprecationWarning, stacklevel=2)
 return d

def readBody ( response ) : def cancel ( deferred ) : abort = getAbort ( ) if ( abort is not None ) : abort ( ) d = defer . Deferred ( cancel ) protocol = _ReadBodyProtocol ( response . code , response . phrase , d ) def getAbort ( ) : return getattr ( protocol . transport , 'abortConnection' , None ) response . deliverBody ( protocol ) if ( ( protocol . transport is not None ) and ( getAbort ( ) is None ) ) : warnings . warn ( 'Using readBody with a transport that does not have an abortConnection method' , category = DeprecationWarning , stacklevel = 2 ) return d
get the body of an l{iresponse} and return it as a byte string .