mirror of
https://github.com/friendica/friendica
synced 2025-04-23 22:30:10 +00:00
Add Feedback :-)
This commit is contained in:
parent
409d909d0f
commit
f4ea74447e
14 changed files with 80 additions and 44 deletions
|
@ -26,7 +26,7 @@ use GuzzleHttp\Exception\TransferException;
|
|||
/**
|
||||
* Interface for calling HTTP requests and returning their responses
|
||||
*/
|
||||
interface ICanRequestPerHttp
|
||||
interface ICanSendHttpRequests
|
||||
{
|
||||
/**
|
||||
* Fetches the content of an URL
|
|
@ -24,7 +24,7 @@ namespace Friendica\Network\HTTPClient\Client;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Network\HTTPClient\Response\CurlResult;
|
||||
use Friendica\Network\HTTPClient\Response\GuzzleResponse;
|
||||
use Friendica\Network\HTTPClient\Capability\ICanRequestPerHttp;
|
||||
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
|
||||
use Friendica\Network\HTTPClient\Capability\ICanHandleHttpResponses;
|
||||
use Friendica\Network\HTTPException\InternalServerErrorException;
|
||||
use Friendica\Util\Network;
|
||||
|
@ -42,7 +42,7 @@ use Psr\Log\LoggerInterface;
|
|||
/**
|
||||
* Performs HTTP requests to a given URL
|
||||
*/
|
||||
class HttpClientCan implements ICanRequestPerHttp
|
||||
class HttpClient implements ICanSendHttpRequests
|
||||
{
|
||||
/** @var LoggerInterface */
|
||||
private $logger;
|
|
@ -6,7 +6,7 @@ use Friendica\App;
|
|||
use Friendica\BaseFactory;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Network\HTTPClient\Client;
|
||||
use Friendica\Network\HTTPClient\Capability\ICanRequestPerHttp;
|
||||
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
|
||||
use Friendica\Util\Profiler;
|
||||
use Friendica\Util\Strings;
|
||||
use GuzzleHttp;
|
||||
|
@ -42,9 +42,9 @@ class HttpClient extends BaseFactory
|
|||
*
|
||||
* @param HandlerStack|null $handlerStack (optional) A handler replacement (just usefull at test environments)
|
||||
*
|
||||
* @return ICanRequestPerHttp
|
||||
* @return ICanSendHttpRequests
|
||||
*/
|
||||
public function createClient(HandlerStack $handlerStack = null): ICanRequestPerHttp
|
||||
public function createClient(HandlerStack $handlerStack = null): ICanSendHttpRequests
|
||||
{
|
||||
$proxy = $this->config->get('system', 'proxy');
|
||||
|
||||
|
@ -108,6 +108,6 @@ class HttpClient extends BaseFactory
|
|||
// Some websites test the browser for cookie support, so this enhances results.
|
||||
$resolver->setCookieJar(get_temppath() .'/resolver-cookie-' . Strings::getRandomName(10));
|
||||
|
||||
return new Client\HttpClientCan($logger, $this->profiler, $guzzle, $resolver);
|
||||
return new Client\HttpClient($logger, $this->profiler, $guzzle, $resolver);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue