mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 17:16:18 +02:00
Merge branch '1.x'
This commit is contained in:
@@ -81,13 +81,18 @@ class SlackWebhookHandler extends AbstractProcessingHandler
|
||||
$postString = json_encode($postData);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $this->webhookUrl);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$options = [
|
||||
CURLOPT_URL => $this->webhookUrl,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HTTPHEADER => ['Content-type: application/json'],
|
||||
CURLOPT_POSTFIELDS => $postString
|
||||
];
|
||||
if (defined('CURLOPT_SAFE_UPLOAD')) {
|
||||
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);
|
||||
$options[CURLOPT_SAFE_UPLOAD] = true;
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, array('payload' => $postString));
|
||||
|
||||
curl_setopt_array($ch, $options);
|
||||
|
||||
Curl\Util::execute($ch);
|
||||
}
|
||||
|
Reference in New Issue
Block a user