Skip to content

Commit

Permalink
Update PrivacyIDEA.php (#38)
Browse files Browse the repository at this point in the history
Add PUT and DELETE
  • Loading branch information
katgirl authored Apr 25, 2023
1 parent 34fad57 commit d3769bb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/PrivacyIDEA.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,16 @@ public function sendRequest(array $params, array $headers, $httpMethod, $endpoin
curl_setopt($curlInstance, CURLOPT_POST, true);
curl_setopt($curlInstance, CURLOPT_POSTFIELDS, $params);
}
elseif ($httpMethod === "PUT")
{
curl_setopt($curlInstance, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curlInstance, CURLOPT_POSTFIELDS, $params);
}
elseif ($httpMethod === "DELETE")
{
curl_setopt($curlInstance, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curlInstance, CURLOPT_POSTFIELDS, $params);
}
elseif ($httpMethod === "GET")
{
$paramsStr = '?';
Expand Down Expand Up @@ -480,4 +490,4 @@ function errorLog($message)
$this->logger->piError("privacyIDEA-PHP-Client: " . $message);
}
}
}
}

0 comments on commit d3769bb

Please sign in to comment.