(array $option)
| 368 | } |
| 369 | |
| 370 | private function buildHtmlRequestHeaders(array $option): array { |
| 371 | $headers = [ |
| 372 | 'Accept' => 'text/html', |
| 373 | 'User-Agent' => 'Analytics for Nextcloud', |
| 374 | ]; |
| 375 | |
| 376 | if (isset($option['token']) && $option['token'] !== '') { |
| 377 | $headers['Authorization'] = 'token ' . $option['token']; |
| 378 | } |
| 379 | |
| 380 | return $headers; |
| 381 | } |
| 382 | |
| 383 | private function getJsonData($url, $option) { |
| 384 | $headers = [ |