(array $option)
| 355 | } |
| 356 | |
| 357 | private function buildHtmlRequestHeaders(array $option): array { |
| 358 | $headers = [ |
| 359 | 'Accept' => 'text/html', |
| 360 | 'User-Agent' => 'Analytics for Nextcloud', |
| 361 | ]; |
| 362 | |
| 363 | if (isset($option['token']) && $option['token'] !== '') { |
| 364 | $headers['Authorization'] = 'token ' . $option['token']; |
| 365 | } |
| 366 | |
| 367 | return $headers; |
| 368 | } |
| 369 | |
| 370 | private function getJsonData($url, $option) { |
| 371 | $headers = [ |