Commit 4558922a authored by Scott Moser's avatar Scott Moser

webhook: report with json data

the handler was passing a dictionary to readurl
which was then passing that on to requests.request as 'data'.
the requests library would urlencode that, but we want the
json data posted instead.

LP: #1496960
parent 03b5cac3
# vi: ts=4 expandtab # vi: ts=4 expandtab
import abc import abc
import json
import six import six
from ..registry import DictRegistry from ..registry import DictRegistry
...@@ -77,7 +78,7 @@ class WebHookHandler(ReportingHandler): ...@@ -77,7 +78,7 @@ class WebHookHandler(ReportingHandler):
readurl = url_helper.readurl readurl = url_helper.readurl
try: try:
return readurl( return readurl(
self.endpoint, data=event.as_dict(), self.endpoint, data=json.dumps(event.as_dict()),
timeout=self.timeout, timeout=self.timeout,
retries=self.retries, ssl_details=self.ssl_details) retries=self.retries, ssl_details=self.ssl_details)
except: except:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment