Added support for post data and updated test

This commit is contained in:
Rudi Grinberg 2012-10-30 15:45:10 -04:00
parent b751482183
commit 24dce45a06
2 changed files with 3 additions and 3 deletions

View file

@ -79,9 +79,10 @@ class ApiRequest(object):
def __init__(self, name, url):
self.name = name
self.url = url
def __call__(self, **kwargs):
def __call__(self,_post_data=None, **kwargs):
final_url = self.url.params(**kwargs).url()
response = urllib2.urlopen(final_url).read()
req = urllib2.Request(final_url, _post_data)
response = urllib2.urlopen(req).read()
return json.loads(response)
class RequestProvider(object):