curl_socket: allow GET/POST request

This commit is contained in:
bergware
2023-12-06 09:13:21 +01:00
parent 56427c2894
commit 7096133313

View File

@@ -13,12 +13,8 @@
<?
function curl_socket($socket, $url, $message) {
$com = curl_init($url);
curl_setopt_array($com,[
CURLOPT_UNIX_SOCKET_PATH => $socket,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $message,
CURLOPT_RETURNTRANSFER => 1
]);
curl_setopt_array($com, [CURLOPT_UNIX_SOCKET_PATH => $socket, CURLOPT_POST => 1]);
if ($message) curl_setopt_array($com, [CURLOPT_POSTFIELDS => $message, CURLOPT_RETURNTRANSFER => 1]);
$reply = curl_exec($com);
curl_close($com);
return $reply;