mirror of
https://github.com/friendica/friendica
synced 2025-04-30 09:44:22 +02:00
Rename DI::httpRequest() into DI::httpClient()
This commit is contained in:
parent
505100bdd7
commit
13a91e63aa
38 changed files with 94 additions and 94 deletions
|
@ -305,7 +305,7 @@ class HTTPSignature
|
|||
|
||||
$headers['Content-Type'] = 'application/activity+json';
|
||||
|
||||
$postResult = DI::httpRequest()->post($target, $content, $headers);
|
||||
$postResult = DI::httpClient()->post($target, $content, $headers);
|
||||
$return_code = $postResult->getReturnCode();
|
||||
|
||||
Logger::log('Transmit to ' . $target . ' returned ' . $return_code, Logger::DEBUG);
|
||||
|
@ -453,9 +453,9 @@ class HTTPSignature
|
|||
$curl_opts[HTTPClientOptions::HEADERS] = $header;
|
||||
|
||||
if (!empty($opts['nobody'])) {
|
||||
$curlResult = DI::httpRequest()->head($request, $curl_opts);
|
||||
$curlResult = DI::httpClient()->head($request, $curl_opts);
|
||||
} else {
|
||||
$curlResult = DI::httpRequest()->get($request, $curl_opts);
|
||||
$curlResult = DI::httpClient()->get($request, $curl_opts);
|
||||
}
|
||||
$return_code = $curlResult->getReturnCode();
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ class Images
|
|||
}
|
||||
|
||||
if (empty($img_str)) {
|
||||
$img_str = DI::httpRequest()->fetch($url, 4);
|
||||
$img_str = DI::httpClient()->fetch($url, 4);
|
||||
}
|
||||
|
||||
if (!$img_str) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class ParseUrl
|
|||
*/
|
||||
public static function getContentType(string $url)
|
||||
{
|
||||
$curlResult = DI::httpRequest()->head($url);
|
||||
$curlResult = DI::httpClient()->head($url);
|
||||
if (!$curlResult->isSuccess()) {
|
||||
return [];
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ class ParseUrl
|
|||
return $siteinfo;
|
||||
}
|
||||
|
||||
$curlResult = DI::httpRequest()->get($url, [HTTPClientOptions::CONTENT_LENGTH => 1000000]);
|
||||
$curlResult = DI::httpClient()->get($url, [HTTPClientOptions::CONTENT_LENGTH => 1000000]);
|
||||
if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
|
||||
return $siteinfo;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue