From d895471b7919322c8705813fd501cdd16b08daf3 Mon Sep 17 00:00:00 2001 From: KevinLauer <72194413+KevinLauer@users.noreply.github.com> Date: Fri, 14 Oct 2022 02:13:51 +0200 Subject: [PATCH] NC Talk POST Request Changed to JSON for correct HTTP 201 response (#669) --- apprise/plugins/NotifyNextcloudTalk.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apprise/plugins/NotifyNextcloudTalk.py b/apprise/plugins/NotifyNextcloudTalk.py index ab3fbecc..e9c58126 100644 --- a/apprise/plugins/NotifyNextcloudTalk.py +++ b/apprise/plugins/NotifyNextcloudTalk.py @@ -24,6 +24,7 @@ import requests +from json import dumps from .NotifyBase import NotifyBase from ..URLBase import PrivacyMode from ..common import NotifyType @@ -134,7 +135,9 @@ class NotifyNextcloudTalk(NotifyBase): # Prepare our Header headers = { 'User-Agent': self.app_id, - 'OCS-APIREQUEST': 'true', + 'OCS-APIRequest': 'true', + 'Accept': 'application/json', + 'Content-Type': 'application/json', } # Apply any/all header over-rides defined @@ -183,7 +186,7 @@ class NotifyNextcloudTalk(NotifyBase): try: r = requests.post( notify_url, - data=payload, + data=dumps(payload), headers=headers, auth=(self.user, self.password), verify=self.verify_certificate,