api.py 文件源码

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

项目:osc-lib 作者: openstack 项目源码 文件源码
def create(
        self,
        url,
        session=None,
        method=None,
        **params
    ):
        """Create a new resource

        :param string url:
            The API-specific portion of the URL path
        :param Session session:
            HTTP client session
        :param string method:
            HTTP method (default POST)
        """

        if not method:
            method = 'POST'
        ret = self._request(method, url, session=session, **params)
        # Should this move into _requests()?
        try:
            return ret.json()
        except json.JSONDecodeError:
            return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号