mirror of
https://github.com/friendica/friendica
synced 2025-05-05 10:24:09 +02:00
Introduce "accept_header" as specific argument to the http client
This commit is contained in:
parent
73c3b21665
commit
e299fc67c8
35 changed files with 150 additions and 150 deletions
|
@ -26,7 +26,6 @@ use Friendica\Database\DBA;
|
|||
use Friendica\DI;
|
||||
use Friendica\Model\GServer;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
class UpdateServerPeers
|
||||
|
@ -37,7 +36,7 @@ class UpdateServerPeers
|
|||
*/
|
||||
public static function execute(string $url)
|
||||
{
|
||||
$ret = DI::httpClient()->get($url . '/api/v1/instance/peers', [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::JSON]);
|
||||
$ret = DI::httpClient()->get($url . '/api/v1/instance/peers', HttpClientAccept::JSON);
|
||||
if (!$ret->isSuccess() || empty($ret->getBody())) {
|
||||
Logger::info('Server is not reachable or does not offer the "peers" endpoint', ['url' => $url]);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue