transport.py 文件源码

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

项目:goodreads-api-client-python 作者: mdzhang 项目源码 文件源码
def _req(self, method: str='GET', endpoint: str=None, params: dict=None,
             data: dict=None, uses_oauth: bool=False):
        if params is None:
            params = {}

        fetch = self.session.request if uses_oauth else requests.request

        res = fetch(
            method=method,
            url='{}/{}'.format(self.base_url, endpoint),
            params={
                'format': 'xml',
                'key': self._developer_key,
                **params
            },
            data=data
        )

        res.raise_for_status()
        return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号