apiai_webhook.py 文件源码

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

项目:apiaiwebhook 作者: paoro-solutions 项目源码 文件源码
def webhook(self,
                action=None,
                parameters={}):
        """
        Uses a regular Flask test client in order to post valid webhook messages.

        :param action: action to tested
        :param parameters: parameters of the action as dictionary
        :return: returns a response object as a regular Flask test client
        """
        req = {
            "result": {
                "action": action,
                "parameters": parameters
            }
        }

        return self.post(
            self.apiai_webhook.webhook_url,
            data=json.dumps(req),
            content_type="application/json",
            headers={self.apiai_webhook.api_key_header: self.apiai_webhook.api_key_value})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号