def create_request(self, method, path, options):
"""Creating a request with the given arguments
If api_version is set, appends it immediately after host
"""
version = '/' + options['api_version'] if 'api_version' in options else ''
# Adds a suffix (ex: ".html", ".json") to url
suffix = options['response_type'] if 'response_type' in options else 'json'
path = path + '.' + suffix
path = urlparse.urljoin(self.base, version + path)
if 'api_version' in options:
del options['api_version']
if 'response_type' in options:
del options['response_type']
return requests.request(method, path, **options)
评论列表
文章目录