From 7c7e48886700517b2974cbd7a1f04b8eb4b438c5 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 25 May 2024 22:05:09 +0200 Subject: [PATCH] Added example with return to the webhook handler. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 469b615b76..efdfaffd1b 100644 --- a/README.md +++ b/README.md @@ -704,7 +704,6 @@ from platypush.events.http.hook import WebhookEvent hook_token = "abcdefabcdef" - # Expose the hook under the /hook/at_home endpoint @when(WebhookEvent, hook="at_home") def at_home_webhook(event: WebhookEvent): @@ -717,6 +716,9 @@ def at_home_webhook(event: WebhookEvent): return run('procedure.at_home') + + # Return anything back to the client + return {'status': 'ok'} ``` Then you can invoke your custom logic over HTTP: