|
@@ 188-191 (lines=4) @@
|
| 185 |
|
); |
| 186 |
|
} |
| 187 |
|
$opts[CURLOPT_HTTPGET] = 1; |
| 188 |
|
if (count($params) > 0) { |
| 189 |
|
$encoded = Util\Util::encodeParameters($params); |
| 190 |
|
$absUrl = "$absUrl?$encoded"; |
| 191 |
|
} |
| 192 |
|
} elseif ($method == 'post') { |
| 193 |
|
$opts[CURLOPT_POST] = 1; |
| 194 |
|
$opts[CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params); |
|
@@ 197-200 (lines=4) @@
|
| 194 |
|
$opts[CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params); |
| 195 |
|
} elseif ($method == 'delete') { |
| 196 |
|
$opts[CURLOPT_CUSTOMREQUEST] = 'DELETE'; |
| 197 |
|
if (count($params) > 0) { |
| 198 |
|
$encoded = Util\Util::encodeParameters($params); |
| 199 |
|
$absUrl = "$absUrl?$encoded"; |
| 200 |
|
} |
| 201 |
|
} else { |
| 202 |
|
throw new Error\Api("Unrecognized method $method"); |
| 203 |
|
} |