def get(self, url, params):
"""
Issues a GET request against the API, properly formatting the params
:param url: a string, the url you are requesting
:param params: a dict, the key-value of all the paramaters needed
in the request
:returns: a dict parsed of the JSON response
"""
url = self.host + url
if params:
url = url + "?" + urllib.urlencode(params)
client = oauth.Client(self.consumer, self.token, proxy_info=self.proxy_info)
client.disable_ssl_certificate_validation = True
try:
client.follow_redirects = False
resp, content = client.request(url, method="GET", redirections=False)
except RedirectLimit, e:
resp, content = e.args
return self.json_parse(content)
评论列表
文章目录