__init__.py 文件源码

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

项目:solidfire-sdk-python 作者: solidfire 项目源码 文件源码
def post(self, data):
        """
        Post data to the associated endpoint and await the server's response.

        :param data: the data to be posted.
        :type data: str or json
        """
        auth = None
        if self._username is None or self._password is None:
            raise ValueError("Username or Password is not set")
        else:
            auth = HTTPBasicAuth(self._username, self._password)
        resp = requests.post(self._endpoint, data=data, json=None,
                             verify=self._verify_ssl, timeout=self._timeout,
                             auth=auth)
        if resp.text == '':
             return {"code": resp.status_code, "name":  resp.reason, "message": ""}
        return resp.text
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号