| @@ 183-191 (lines=9) @@ | ||
| 180 | * |
|
| 181 | * @return mixed |
|
| 182 | */ |
|
| 183 | public function getJSON($url, $query = []) |
|
| 184 | { |
|
| 185 | $response = $this->request('GET', $url, [ |
|
| 186 | 'query' => $query, |
|
| 187 | 'headers' => ['Accept' => 'application/json'], |
|
| 188 | ]); |
|
| 189 | ||
| 190 | return json_decode($response->getBody()); |
|
| 191 | } |
|
| 192 | ||
| 193 | /** |
|
| 194 | * Make a GET request, accepting XML. |
|
| @@ 201-209 (lines=9) @@ | ||
| 198 | * |
|
| 199 | * @return mixed |
|
| 200 | */ |
|
| 201 | public function getXML($url, $query = []) |
|
| 202 | { |
|
| 203 | $response = $this->request('GET', $url, [ |
|
| 204 | 'query' => $query, |
|
| 205 | 'headers' => ['Accept' => 'application/xml'], |
|
| 206 | ]); |
|
| 207 | ||
| 208 | return new QuiteSimpleXMLElement(strval($response->getBody())); |
|
| 209 | } |
|
| 210 | ||
| 211 | /** |
|
| 212 | * Make a PUT request. |
|