@@ 160-163 (lines=4) @@ | ||
157 | curl_setopt($ch, CURLOPT_ENCODING, ''); |
|
158 | ||
159 | switch($http_verb) { |
|
160 | case 'post': |
|
161 | curl_setopt($ch, CURLOPT_POST, true); |
|
162 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($args)); |
|
163 | break; |
|
164 | ||
165 | case 'get': |
|
166 | $query = http_build_query($args); |
|
@@ 174-177 (lines=4) @@ | ||
171 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); |
|
172 | break; |
|
173 | ||
174 | case 'patch': |
|
175 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); |
|
176 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($args)); |
|
177 | break; |
|
178 | ||
179 | case 'put': |
|
180 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); |
|
@@ 179-182 (lines=4) @@ | ||
176 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($args)); |
|
177 | break; |
|
178 | ||
179 | case 'put': |
|
180 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); |
|
181 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($args)); |
|
182 | break; |
|
183 | } |
|
184 | ||
185 | $response['body'] = curl_exec($ch); |