diff --git a/LibreNMS/Alert/Transport/Api.php b/LibreNMS/Alert/Transport/Api.php index 0a1b0bde32..b138a3f911 100644 --- a/LibreNMS/Alert/Transport/Api.php +++ b/LibreNMS/Alert/Transport/Api.php @@ -44,6 +44,9 @@ class Api implements Transport curl_setopt($curl, CURLOPT_URL, ($method == "get" ? $host."?".$api : $host)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, strtoupper($method)); + if (json_decode($api) !== null) { + curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json")); + } curl_setopt($curl, CURLOPT_POSTFIELDS, $api); $ret = curl_exec($curl); $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);