Skip to content

Commit 067d73e

Browse files
committed
Only set CURLOPT_POSTFIELDS options if post data is not empty for DELETE method
1 parent 8f0a52b commit 067d73e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Curl/Curl.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ public function delete($url, $query_parameters = array(), $data = array())
265265

266266
$this->setUrl($url, $query_parameters);
267267
$this->setOpt(CURLOPT_CUSTOMREQUEST, 'DELETE');
268-
$this->setOpt(CURLOPT_POSTFIELDS, $this->buildPostData($data));
268+
if (!empty($data)) {
269+
$this->setOpt(CURLOPT_POSTFIELDS, $this->buildPostData($data));
270+
}
269271
return $this->exec();
270272
}
271273

0 commit comments

Comments
 (0)