コード例 #1
0
 def httpPost(self, url, data, headers=None, timeout=None):
     """
     Send the specified data to the specified URL.
     
     If credentials have been specified, they will be used in case
     of HTTP basic authentication.
     
     @param url:        The URL to be accessed.
     @type url:         string
     
     @param data:       The data to be sent to the URL.
     @type data:        string
     
     @param headers:    A dictionary of additional HTTP request headers.
     @type headers:     dict
     
     @param timeout:    Timeout for the request in seconds, or None.
     @type timeout:     float
     
     @return:           HttpResult object.
     @rtype:            HttpResult
     
     """
     res                  = HttpResult()
     res.status, res.data = self.__http_access("POST", url, data, headers, timeout)
     return res
コード例 #2
0
 def httpGet(self, url, headers=None):
     """
     Accesses the specified URL.
     
     If credentials have been specified, they will be used in case
     of HTTP basic authentication.
     
     @param url:        The URL to be accessed.
     @type url:         string
     
     @param headers:    A dictionary of additional HTTP request headers.
     @type headers:     dict
     
     @return:           HttpResult object.
     @rtype:            HttpResult
     
     """
     res = HttpResult()
     res.status, res.data = self.__http_access(url, headers=headers)
     return res
コード例 #3
0
 def httpGet(self, url, headers=None):
     """
     Accesses the specified URL.
     
     If credentials have been specified, they will be used in case
     of HTTP basic authentication.
     
     @param url:        The URL to be accessed.
     @type url:         string
     
     @param headers:    A dictionary of additional HTTP request headers.
     @type headers:     dict
     
     @return:           HttpResult object.
     @rtype:            HttpResult
     
     """
     res                  = HttpResult()
     res.status, res.data = self.__http_access(url, headers=headers)
     return res
コード例 #4
0
 def accessResourceProxy(self, uri, input, params, method):
     res = HttpResult()
     res.status, res.data = accessResource(uri, input, self.from_java_conversion_func(params), method)
     res.data = self.to_java_conversion_func(res.data)
     return res
コード例 #5
0
 def accessResourceProxy(self, uri, input, params, method):
     res = HttpResult()
     res.status, res.data = accessResource(
         uri, input, self.from_java_conversion_func(params), method)
     res.data = self.to_java_conversion_func(res.data)
     return res