1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-30 21:30:14 +02:00

refactor: extract CurlHttpClient (#3532)

* refactor: extract CurlHttpClient

* refactor

* interface
This commit is contained in:
Dag
2023-07-16 22:07:34 +02:00
committed by GitHub
parent 7b46b97abd
commit a59793e8d6
4 changed files with 145 additions and 138 deletions

View File

@@ -14,7 +14,8 @@ while ($next) { /* Collect all contributors */
'Content-Type' => 'application/json',
'User-Agent' => 'RSS-Bridge',
];
$result = _http_request($url, ['headers' => $headers]);
$httpClient = new CurlHttpClient();
$result = $httpClient->request($url, ['headers' => $headers]);
foreach (json_decode($result['body']) as $contributor) {
$contributors[] = $contributor;