mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-28 19:20:56 +00:00
Only set CURLOPT_POSTFIELDS options if post data is not empty for DELETE method
This commit is contained in:
+3
-1
@@ -265,7 +265,9 @@ class Curl
|
||||
|
||||
$this->setUrl($url, $query_parameters);
|
||||
$this->setOpt(CURLOPT_CUSTOMREQUEST, 'DELETE');
|
||||
$this->setOpt(CURLOPT_POSTFIELDS, $this->buildPostData($data));
|
||||
if (!empty($data)) {
|
||||
$this->setOpt(CURLOPT_POSTFIELDS, $this->buildPostData($data));
|
||||
}
|
||||
return $this->exec();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user