curl_socket: allow GET/POST request

This commit is contained in:
bergware
2023-12-06 09:17:23 +01:00
parent 7096133313
commit be877cc6e5
+1 -1
View File
@@ -11,7 +11,7 @@
*/
?>
<?
function curl_socket($socket, $url, $message) {
function curl_socket($socket, $url, $message='') {
$com = curl_init($url);
curl_setopt_array($com, [CURLOPT_UNIX_SOCKET_PATH => $socket, CURLOPT_POST => 1]);
if ($message) curl_setopt_array($com, [CURLOPT_POSTFIELDS => $message, CURLOPT_RETURNTRANSFER => 1]);