restsession.py 文件源码

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

项目:ciscosparkapi 作者: CiscoDevNet 项目源码 文件源码
def get(self, url, params=None, **kwargs):
        """Sends a GET request.

        Args:
            url(basestring): The URL of the API endpoint.
            params(dict): The parameters for the HTTP GET request.
            **kwargs:
                erc(int): The expected (success) response code for the request.
                others: Passed on to the requests package.

        Raises:
            SparkApiError: If anything other than the expected response code is
                returned by the Cisco Spark API endpoint.

        """
        assert isinstance(url, basestring)
        assert params is None or isinstance(params, dict)

        # Expected response code
        erc = kwargs.pop('erc', EXPECTED_RESPONSE_CODE['GET'])

        response = self.request('GET', url, erc, params=params, **kwargs)
        return extract_and_parse_json(response)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号