Skip to content

Commit fffad8d

Browse files
authored
Update Curl.php
Added support for PUT requests
1 parent d403ec9 commit fffad8d

File tree

1 file changed

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

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
175175
if ($method == \Zend_Http_Client::POST) {
176176
curl_setopt($this->_getResource(), CURLOPT_POST, true);
177177
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
178+
} elseif ($method == \Zend_Http_Client::PUT) {
179+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'PUT');
180+
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
178181
} elseif ($method == \Zend_Http_Client::GET) {
179182
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
180183
}

0 commit comments

Comments
 (0)