@@ -166,16 +166,19 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
166
166
// set url to post to
167
167
curl_setopt ($ this ->_getResource (), CURLOPT_URL , $ url );
168
168
curl_setopt ($ this ->_getResource (), CURLOPT_RETURNTRANSFER , true );
169
- if ($ method == \Zend_Http_Client::POST ) {
169
+ if ($ method === \Zend_Http_Client::POST ) {
170
170
curl_setopt ($ this ->_getResource (), CURLOPT_POST , true );
171
171
curl_setopt ($ this ->_getResource (), CURLOPT_CUSTOMREQUEST , 'POST ' );
172
172
curl_setopt ($ this ->_getResource (), CURLOPT_POSTFIELDS , $ body );
173
- } elseif ($ method == \Zend_Http_Client::PUT ) {
173
+ } elseif ($ method === \Zend_Http_Client::PUT ) {
174
174
curl_setopt ($ this ->_getResource (), CURLOPT_CUSTOMREQUEST , 'PUT ' );
175
175
curl_setopt ($ this ->_getResource (), CURLOPT_POSTFIELDS , $ body );
176
- } elseif ($ method == \Zend_Http_Client::GET ) {
176
+ } elseif ($ method === \Zend_Http_Client::GET ) {
177
177
curl_setopt ($ this ->_getResource (), CURLOPT_HTTPGET , true );
178
178
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 );
179
182
}
180
183
181
184
if ($ http_ver === \Zend_Http_Client::HTTP_1 ) {
0 commit comments