Skip to content

Commit 1c20d23

Browse files
ENGCOM-6682: Http adapter curl missing delete method #25742
- Merge Pull Request #25742 from jimuld/magento2:Http-Adapter-Curl-Missing-Delete-Method - Merged commits: 1. 4e85593 2. da34cbe 3. a409774 4. 7832925
2 parents 29cb41d + 7832925 commit 1c20d23

File tree

1 file changed

+6
-3
lines changed
  • lib/internal/Magento/Framework/HTTP/Adapter

1 file changed

+6
-3
lines changed

lib/internal/Magento/Framework/HTTP/Adapter/Curl.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,19 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
166166
// set url to post to
167167
curl_setopt($this->_getResource(), CURLOPT_URL, $url);
168168
curl_setopt($this->_getResource(), CURLOPT_RETURNTRANSFER, true);
169-
if ($method == \Zend_Http_Client::POST) {
169+
if ($method === \Zend_Http_Client::POST) {
170170
curl_setopt($this->_getResource(), CURLOPT_POST, true);
171171
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'POST');
172172
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
173-
} elseif ($method == \Zend_Http_Client::PUT) {
173+
} elseif ($method === \Zend_Http_Client::PUT) {
174174
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'PUT');
175175
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
176-
} elseif ($method == \Zend_Http_Client::GET) {
176+
} elseif ($method === \Zend_Http_Client::GET) {
177177
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
178178
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'GET');
179+
} elseif ($method === \Zend_Http_Client::DELETE) {
180+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'DELETE');
181+
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
179182
}
180183

181184
if ($http_ver === \Zend_Http_Client::HTTP_1) {

0 commit comments

Comments
 (0)