Added PUT method using CURLOPT_CUSTOMREQUEST
This commit is contained in:
@@ -241,6 +241,10 @@ class Client extends Base
|
|||||||
if ('POST' === $method) {
|
if ('POST' === $method) {
|
||||||
curl_setopt($curlSession, CURLOPT_POST, true);
|
curl_setopt($curlSession, CURLOPT_POST, true);
|
||||||
curl_setopt($curlSession, CURLOPT_POSTFIELDS, $content);
|
curl_setopt($curlSession, CURLOPT_POSTFIELDS, $content);
|
||||||
|
} elseif ('PUT' === $method) {
|
||||||
|
curl_setopt($curlSession, CURLOPT_CUSTOMREQUEST, 'PUT');
|
||||||
|
curl_setopt($curlSession, CURLOPT_POST, true);
|
||||||
|
curl_setopt($curlSession, CURLOPT_POSTFIELDS, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($headers)) {
|
if (! empty($headers)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user