Example #1
0
 def do_post(self, params):
     url_str = self.url_info.get_site_with_path()
     is_https = True if self.url_info.protocol == "https" else False
     return WebUtil.do_post(url_str,
                            self.url_info,
                            self.fix_params(self.get_headers(), params,
                                            METHOD_POST,
                                            UrlParser(url_str).path),
                            self.get_headers(),
                            is_https=is_https)
Example #2
0
 def do_get(self, action, params):
     url_str = self.url_info.get_site_with_append_path(action)
     is_https = True if self.url_info.protocol == "https" else False
     return WebUtil.do_get(url_str,
                           self.url_info,
                           self.fix_params(self.get_headers(), params,
                                           METHOD_GET,
                                           UrlParser(url_str).path),
                           self.get_headers(),
                           is_https=is_https)
Example #3
0
 def __init__(self, url, key, secret):
     self.url = url
     self.key = key
     self.secret = secret
     self.url_info = UrlParser(self.url)
     self.token_url = self.url_info.get_site_path("/oauth/token")
     self.authorize_url = self.url_info.get_site_path("/oauth/authorize")
     self.check_session_url = self.url_info.get_site_with_append_path(
         "/platform/oauth/session_check")
     self.sys_params = {}
     self.token = ""
     self.session_id = ""
     self.refresh_token = ""
     self.init_sys_params()