| @@ 241-250 (lines=10) @@ | ||
| 238 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
| 239 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
| 240 | break; |
|
| 241 | case 'PUT': |
|
| 242 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
| 243 | if (isset($query)) { |
|
| 244 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
| 245 | } |
|
| 246 | ||
| 247 | if (isset($body)) { |
|
| 248 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
|
| 249 | } |
|
| 250 | break; |
|
| 251 | case 'POST': |
|
| 252 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
|
| 253 | if (isset($query)) { |
|
| @@ 251-260 (lines=10) @@ | ||
| 248 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
|
| 249 | } |
|
| 250 | break; |
|
| 251 | case 'POST': |
|
| 252 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
|
| 253 | if (isset($query)) { |
|
| 254 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
| 255 | } |
|
| 256 | ||
| 257 | if (isset($body)) { |
|
| 258 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
|
| 259 | } |
|
| 260 | break; |
|
| 261 | case 'ADD': |
|
| 262 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
| 263 | } |
|