Exemple #1
0
 def perform_request(self, pb_data, tab_data):
     params = OrderedDict({proto_url_encode(pb_data, '&'): ''})
     params.update(tab_data)
     params['token'] = self.hash_token(
         urlparse(self.url).path + '?' + self.rebuild_qs(params))
     return get(self.url + '?' + self.rebuild_qs(params),
                headers=USER_AGENT)
Exemple #2
0
 def perform_request(self, pb_data, tab_data):
     params = {self.pb_param: proto_url_encode(pb_data), **tab_data}
     url = sub('\{(\w+)\}', lambda i: my_quote(params.pop(i.group(1))),
               self.url)
     if params:
         url += '?' + urlencode(
             params, safe='~()*!.')  # Do not escape '!' for readibility.
     return get(url, headers=USER_AGENT)