예제 #1
0
 def __init__(self, *args, **kwargs):
     BaseHttpClient.__init__(self, *args, **kwargs)
     self.default_headers = {'Connection': 'keep-alive'}
     gitlab_service_info = custom_config.GITLAB_SERVICE_API
     if gitlab_service_info is not None:
         for k, v in gitlab_service_info.items():
             setattr(self, k, v)
예제 #2
0
    def __init__(self, token, *args, **kwargs):
        BaseHttpClient.__init__(self, *args, **kwargs)
        self.default_headers = {'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'}
        self.default_params = {'AccessToken': token}

        api_info = settings.UCLOUD_APP
        for k, v in api_info.items():
            setattr(self, k, v)
예제 #3
0
 def __init__(self, sso_user_id, sso_user_token, *args, **kwargs):
     BaseHttpClient.__init__(self, *args, **kwargs)
     self.default_headers = {
         'Content-Type': 'application/json',
         'Accept': 'application/json',
         'Authorization': 'Bearer {0}'.format(sso_user_token)
     }
     self.base_url = SSO_BASE_URL
     self.sso_user_id = sso_user_id
     self.sso_user_token = sso_user_token
예제 #4
0
 def __init__(self, *args, **kwargs):
     BaseHttpClient.__init__(self, *args, **kwargs)
     self.default_headers = {'Connection': 'keep-alive', 'Content-Type': 'application/json'}
     self.url = settings.APP_SERVICE_API["url"]
예제 #5
0
 def __init__(self, *args, **kwargs):
     BaseHttpClient.__init__(self, *args, **kwargs)
     self.default_headers = {'Connection': 'keep-alive'}
     self.base_url = 'https://api.github.com'
예제 #6
0
 def __init__(self, *args, **kwargs):
     BaseHttpClient.__init__(self, *args, **kwargs)
     self.default_headers = {'Connection': 'keep-alive'}
예제 #7
0
 def __init__(self, *args, **kwargs):
     BaseHttpClient.__init__(self, *args, **kwargs)
     self.default_headers = {
         'Connection': 'keep-alive',
         'Content-Type': 'application/json'
     }
예제 #8
0
 def __init__(self, *args, **kwargs):
     BaseHttpClient.__init__(self, *args, **kwargs)
     self.default_headers = {'Connection': 'keep-alive', 'Content-Type': 'application/json'}
     youpai_infos = settings.YOUPAI
     self.default_headers.update({"Authorization": "Bearer " + youpai_infos["ACCESS_TOKEN"]})
     self.BaseAPIURL = youpai_infos["URL"]