1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 12:17:35 +02:00

Explicitly set content-type header, and post JSON as body

This commit is contained in:
Harm Bandstra
2017-03-27 16:32:27 +02:00
committed by Jordi Boggiano
parent 188a46836b
commit 52d9096b14

View File

@@ -87,7 +87,8 @@ class SlackWebhookHandler extends AbstractProcessingHandler
if (defined('CURLOPT_SAFE_UPLOAD')) {
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);
}
curl_setopt($ch, CURLOPT_POSTFIELDS, array('payload' => $postString));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
Curl\Util::execute($ch);
}