mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-26 14:39:22 +00:00
Fix #506: Remove content-length header for PATCH requests when data is empty
This commit is contained in:
@@ -183,12 +183,17 @@ class MultiCurl
|
||||
$data = $url;
|
||||
$url = $this->baseUrl;
|
||||
}
|
||||
|
||||
$curl = new Curl();
|
||||
|
||||
if (is_array($data) && empty($data)) {
|
||||
$curl->removeHeader('Content-Length');
|
||||
}
|
||||
|
||||
$this->queueHandle($curl);
|
||||
$curl->setUrl($url);
|
||||
$curl->removeHeader('Content-Length');
|
||||
$curl->setOpt(CURLOPT_CUSTOMREQUEST, 'PATCH');
|
||||
$curl->setOpt(CURLOPT_POSTFIELDS, $data);
|
||||
$curl->setOpt(CURLOPT_POSTFIELDS, $curl->buildPostData($data));
|
||||
return $curl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user