@@ -84,31 +84,31 @@ |
||
| 84 | 84 | curl_setopt($ch, CURLOPT_POSTFIELDS, $body); |
| 85 | 85 | } else { |
| 86 | 86 | switch ($method) { |
| 87 | - case 'DELETE': |
|
| 88 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); |
|
| 89 | - break; |
|
| 90 | - case 'DELETEARRAY': |
|
| 91 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); |
|
| 92 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
| 93 | - break; |
|
| 94 | - case 'PUT': |
|
| 95 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); |
|
| 96 | - break; |
|
| 97 | - case 'POST': |
|
| 98 | - if (isset($body)) { |
|
| 99 | - $bodyData = json_encode($body); |
|
| 100 | - if (isset($options['HTTPHEADER'])) { |
|
| 101 | - if (strpos($options['HTTPHEADER'], 'multipart/form-data') > 0) { |
|
| 102 | - $bodyData = $body; |
|
| 103 | - } |
|
| 87 | + case 'DELETE': |
|
| 88 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); |
|
| 89 | + break; |
|
| 90 | + case 'DELETEARRAY': |
|
| 91 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); |
|
| 92 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
| 93 | + break; |
|
| 94 | + case 'PUT': |
|
| 95 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); |
|
| 96 | + break; |
|
| 97 | + case 'POST': |
|
| 98 | + if (isset($body)) { |
|
| 99 | + $bodyData = json_encode($body); |
|
| 100 | + if (isset($options['HTTPHEADER'])) { |
|
| 101 | + if (strpos($options['HTTPHEADER'], 'multipart/form-data') > 0) { |
|
| 102 | + $bodyData = $body; |
|
| 104 | 103 | } |
| 105 | - |
|
| 106 | - curl_setopt($ch, CURLOPT_POSTFIELDS, $bodyData); |
|
| 107 | 104 | } |
| 108 | - break; |
|
| 109 | - case 'ADD': |
|
| 110 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
| 111 | - break; |
|
| 105 | + |
|
| 106 | + curl_setopt($ch, CURLOPT_POSTFIELDS, $bodyData); |
|
| 107 | + } |
|
| 108 | + break; |
|
| 109 | + case 'ADD': |
|
| 110 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
| 111 | + break; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if (is_numeric(array_search($method, ['DELETE', 'PUT']))) { |