From 46c7896882e5a29b308c5587a3f57fa9679009d5 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 9 Feb 2021 15:47:22 -0700 Subject: [PATCH] Girocco/Notify.pm: implement application/json POST type If "application/json" has been chosen as the JSON POST Content-Type, then POST a single body of that content-type consisting of the raw JSON notification. Signed-off-by: Kyle J. McKay --- Girocco/Notify.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Girocco/Notify.pm b/Girocco/Notify.pm index d9b3540..898e843 100644 --- a/Girocco/Notify.pm +++ b/Girocco/Notify.pm @@ -127,7 +127,11 @@ sub json { # print "$payload\n"; my $ua = LWP::UserAgent->new; $ua->timeout(5); - $ua->post($url, { payload => $payload }); + if (defined($proj->{jsontype}) && $proj->{jsontype} eq 'application/json') { + $ua->post($url, Content_Type => 'application/json', Content => $payload); + } else { + $ua->post($url, { payload => $payload }); + } } -- 2.11.4.GIT