File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -81,14 +81,18 @@ protected function write(array $record)
81
81
$ postString = json_encode ($ postData );
82
82
83
83
$ ch = curl_init ();
84
- curl_setopt ($ ch , CURLOPT_URL , $ this ->webhookUrl );
85
- curl_setopt ($ ch , CURLOPT_POST , true );
86
- curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , true );
84
+ $ options = [
85
+ CURLOPT_URL => $ this ->webhookUrl ,
86
+ CURLOPT_POST => true ,
87
+ CURLOPT_RETURNTRANSFER => true ,
88
+ CURLOPT_HTTPHEADER => ['Content-type: application/json ' ],
89
+ CURLOPT_POSTFIELDS => $ postString
90
+ ];
87
91
if (defined ('CURLOPT_SAFE_UPLOAD ' )) {
88
- curl_setopt ( $ ch , CURLOPT_SAFE_UPLOAD , true ) ;
92
+ $ options [ CURLOPT_SAFE_UPLOAD ] = true ;
89
93
}
90
- curl_setopt ( $ ch , CURLOPT_HTTPHEADER , [ ' Content-type: application/json ' ]);
91
- curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ postString );
94
+
95
+ curl_setopt_array ($ ch , $ options );
92
96
93
97
Curl \Util::execute ($ ch );
94
98
}
You can’t perform that action at this time.
0 commit comments