mirror of https://github.com/caronc/apprise
NC Talk POST Request Changed to JSON for correct HTTP 201 response (#669)
parent
b989427215
commit
d895471b79
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
from json import dumps
|
||||||
from .NotifyBase import NotifyBase
|
from .NotifyBase import NotifyBase
|
||||||
from ..URLBase import PrivacyMode
|
from ..URLBase import PrivacyMode
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
|
@ -134,7 +135,9 @@ class NotifyNextcloudTalk(NotifyBase):
|
||||||
# Prepare our Header
|
# Prepare our Header
|
||||||
headers = {
|
headers = {
|
||||||
'User-Agent': self.app_id,
|
'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
|
# Apply any/all header over-rides defined
|
||||||
|
@ -183,7 +186,7 @@ class NotifyNextcloudTalk(NotifyBase):
|
||||||
try:
|
try:
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
notify_url,
|
notify_url,
|
||||||
data=payload,
|
data=dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
auth=(self.user, self.password),
|
auth=(self.user, self.password),
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
|
Loading…
Reference in New Issue