From 4740d0fbf31024c2983e0942b0b491527b120867 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Tue, 14 Jan 2020 17:36:25 -0800 Subject: [PATCH] Change webhook request data if not Content-Type header is not application/json --- plexpy/notifiers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index ce095db4..adadc3f6 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -3636,7 +3636,12 @@ class WEBHOOK(Notifier): if webhook_headers: headers.update(webhook_headers) - return self.make_request(self.config['hook'], method=self.config['method'], headers=headers, json=webhook_body) + if headers['Content-Type'] == 'application/json': + data = {'json': webhook_body} + else: + data = {'data': webhook_body} + + return self.make_request(self.config['hook'], method=self.config['method'], headers=headers, **data) def _return_config_options(self): config_option = [{'label': 'Webhook URL',