Skip to content

Commit 475ecee

Browse files
author
Oleksii Korshenko
authored
MAGETWO-69737: Update Curl.php #7405
2 parents 7592b8c + 11eb059 commit 475ecee

File tree

1 file changed

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

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,14 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
173173
curl_setopt($this->_getResource(), CURLOPT_RETURNTRANSFER, true);
174174
if ($method == \Zend_Http_Client::POST) {
175175
curl_setopt($this->_getResource(), CURLOPT_POST, true);
176+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'POST');
176177
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
177-
} elseif ($method == \Zend_Http_Client::GET) {
178-
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
179178
} elseif ($method == \Zend_Http_Client::PUT) {
180-
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, \Zend_Http_Client::PUT);
179+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'PUT');
181180
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
181+
} elseif ($method == \Zend_Http_Client::GET) {
182+
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
183+
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'GET');
182184
}
183185

184186
if (is_array($headers)) {

0 commit comments

Comments
 (0)