def post(self, url, params={}, files=[]):
"""
Issues a POST request against the API, allows for multipart data uploads
:param url: a string, the url you are requesting
:param params: a dict, the key-value of all the parameters needed
in the request
:param files: a list, the list of tuples of files
:returns: a dict parsed of the JSON response
"""
url = self.host + url
try:
if files:
return self.post_multipart(url, params, files)
else:
client = oauth.Client(self.consumer, self.token, proxy_info=self.proxy_info)
client.disable_ssl_certificate_validation = True
resp, content = client.request(url, method="POST", body=urllib.urlencode(params))
return self.json_parse(content)
except urllib2.HTTPError, e:
return self.json_parse(e.read())
评论列表
文章目录