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})
评论列表
文章目录