code: def read_response(self, response=None):
          '''Read the response's HTTP status line and header fields.
  
          Coroutine.
          '''
          _logger.debug('Reading header.')
  
          if response is None:
              response = Response()
  
          header_lines = []
          bytes_read = 0
  
          while True:
              try:
                  data = yield from self._connection.readline()
              except ValueError as error:
                  raise ProtocolError(
                      'Invalid header: {0}'.format(error)) from error
  
              self._data_event_dispatcher.notify_read(data)
  
              if not data.endswith(b'\n'):
                  raise NetworkError('Connection closed.')
              elif data in (b'\r\n', b'\n'):
                  break
  
              header_lines.append(data)
              assert data.endswith(b'\n')
  
              bytes_read += len(data)
  
              if bytes_read > 32768:
                  raise ProtocolError('Header too big.')
  
          if not header_lines:
              raise ProtocolError('No header received.')
  
          response.parse(b''.join(header_lines))
  
          return responsf read_response(self, response=None):
          '''Read the response's HTTP status line and header fields.
  
          Coroutine.
          '''
          _logger.debug('Reading header.')
  
          if response is None:
              response = Response()
  
          header_lines = []
          bytes_read = 0
  
          while True:
              try:
                  data = yield from self._connection.readline()
              except ValueError as error:
                  raise ProtocolError(
                      'Invalid header: {0}'.format(error)) from error
  
              self._data_event_dispatcher.notify_read(data)
  
              if not data.endswith(b'\n'):
                  raise NetworkError('Connection closed.')
              elif data in (b'\r\n', b'\n'):
                  break
  
              header_lines.append(data)
              assert data.endswith(b'\n')
  
              bytes_read += len(data)
  
              if bytes_read > 32768:
                  raise ProtocolError('Header too big.')
  
          if not header_lines:
              raise ProtocolError('No header received.')
  
          response.parse(b''.join(header_lines))
  
          return response
docs: Read the response's HTTP status line and header fields.
  
          Coroutine.