__init__.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:buffer-api 作者: barisariburnu 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号