parameters: (self, request_path, payload=None,
             content_type="application/octet-stream",
             timeout=None,
             extra_headers=None,
             **kwargs)
docstring: Sends an RPC and returns the response.
  
      Args:
        request_path: The path to send the request to, eg /api/appversion/create.
        payload: The body of the request, or None to send an empty request.
        content_type: The Content-Type header to use.
        timeout: timeout in seconds; default None i.e. no timeout.
          (Note: for large requests on OS X, the timeout doesn't work right.)
        extra_headers: Dict containing additional HTTP headers that should be
          included in the request (string header names mapped to their values),
          or None to not include any additional headers.
        kwargs: Any keyword arguments are converted into query string parameters.
  
      Returns:
        The response body, as a string.
docstring_summary: Sends an RPC and returns the response.
docstring_tokens: Sends an RPC and returns the response .
function: def Send(self, request_path, payload=None,
             content_type="application/octet-stream",
             timeout=None,
             extra_headers=None,
             **kwargs):
      """Sends an RPC and returns the response.
  
      Args:
        request_path: The path to send the request to, eg /api/appversion/create.
        payload: The body of the request, or None to send an empty request.
        content_type: The Content-Type header to use.
        timeout: timeout in seconds; default None i.e. no timeout.
          (Note: for large requests on OS X, the timeout doesn't work right.)
        extra_headers: Dict containing additional HTTP headers that should be
          included in the request (string header names mapped to their values),
          or None to not include any additional headers.
        kwargs: Any keyword arguments are converted into query string parameters.
  
      Returns:
        The response body, as a string.
      """
      # TODO: Don't require authentication.  Let the server say
      # whether it is necessary.
      if not self.authenticated:
        self._Authenticate()
  
      old_timeout = socket.getdefaulttimeout()
      socket.setdefaulttimeout(timeout)
      try:
        tries = 0
        while True:
          tries += 1
          args = dict(kwargs)
          url = "%s%s" % (self.host, request_path)
          if args:
            url += "?" + urllib.urlencode(args)
          req = self._CreateRequest(url=url, data=payload)
          req.add_header("Content-Type", content_type)
          if extra_headers:
            for header, value in extra_headers.items():
              req.add_header(header, value)
          try:
            f = self.opener.open(req)
            response = f.read()
            f.close()
            return response
          except urllib2.HTTPError, e:
            if tries > 3:
              raise
            elif e.code == 401 or e.code == 302:
              self._Authenticate()
            elif e.code == 301:
              # Handle permanent redirect manually.
              url = e.info()["location"]
              url_loc = urlparse.urlparse(url)
              self.host = '%s://%s' % (url_loc[0], url_loc[1])
            elif e.code >= 500:
              ErrorExit(e.read())
            else:
              raise
      finally:
        socket.setdefaulttimeout(old_timeout)
function_tokens: def Send ( self , request_path , payload = None , content_type = "application/octet-stream" , timeout = None , extra_headers = None , * * kwargs ) : # TODO: Don't require authentication.  Let the server say # whether it is necessary. if not self . authenticated : self . _Authenticate ( ) old_timeout = socket . getdefaulttimeout ( ) socket . setdefaulttimeout ( timeout ) try : tries = 0 while True : tries += 1 args = dict ( kwargs ) url = "%s%s" % ( self . host , request_path ) if args : url += "?" + urllib . urlencode ( args ) req = self . _CreateRequest ( url = url , data = payload ) req . add_header ( "Content-Type" , content_type ) if extra_headers : for header , value in extra_headers . items ( ) : req . add_header ( header , value ) try : f = self . opener . open ( req ) response = f . read ( ) f . close ( ) return response except urllib2 . HTTPError , e : if tries > 3 : raise elif e . code == 401 or e . code == 302 : self . _Authenticate ( ) elif e . code == 301 : # Handle permanent redirect manually. url = e . info ( ) [ "location" ] url_loc = urlparse . urlparse ( url ) self . host = '%s://%s' % ( url_loc [ 0 ] , url_loc [ 1 ] ) elif e . code >= 500 : ErrorExit ( e . read ( ) ) else : raise finally : socket . setdefaulttimeout ( old_timeout )