def _DoRequestResponse(
      self, method, url, body=None, headers=None, output_file=None):
    """Connect to hostname, make a request, obtain response.

    Args:
      method: str, like 'GET' or 'POST'
      url: str, url like '/foo.html', not 'http://host/foo.html'
      body: str or dict or file, optional, body to send with request
      headers: dict, optional, headers to send with request
      output_file: file, optional, file to write response body to
    Returns:
      Response instance
    Raises:
      HTTPError: if a connection level error occured
    """
    try:
      suffix = self.use_https * 's'
      logging.debug('Connecting to http%s://%s:%s',
                    suffix, self.hostname, self.port)
      conn = self._Connect()
      # if proxy is in use, request the full URL including host.
      if self.proxy_hostname:
        url = 'http%s://%s%s' % (self.use_https * 's', self.netloc, url)
      logging.debug('Requesting %s %s', method, url)
      self._Request(method, conn, url, body=body, headers=headers)
      logging.debug('Waiting for response')
      response = self._GetResponse(conn, output_file=output_file)
      logging.debug('Response status %d', response.status)
      return response
    except httplib.HTTPException, e:
      raise HTTPError(str(e))
dataset/ETHPy150Open google/simian/src/simian/client/client.py/HttpsClient._DoRequestResponse/original