Restructure HTTPClient for new paradigm
This commit is contained in:
parent
fa55928ea3
commit
409d909d0f
25 changed files with 210 additions and 198 deletions
105
src/Network/HTTPClient/Capability/ICanHandleHttpResponses.php
Normal file
105
src/Network/HTTPClient/Capability/ICanHandleHttpResponses.php
Normal file
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Network\HTTPClient\Capability;
|
||||
|
||||
use Psr\Http\Message\MessageInterface;
|
||||
|
||||
/**
|
||||
* Temporary class to map Friendica used variables based on PSR-7 HTTPResponse
|
||||
*/
|
||||
interface ICanHandleHttpResponses
|
||||
{
|
||||
/**
|
||||
* Gets the Return Code
|
||||
*
|
||||
* @return string The Return Code
|
||||
*/
|
||||
public function getReturnCode();
|
||||
|
||||
/**
|
||||
* Returns the Content Type
|
||||
*
|
||||
* @return string the Content Type
|
||||
*/
|
||||
public function getContentType();
|
||||
|
||||
/**
|
||||
* Returns the headers
|
||||
*
|
||||
* @param string $header optional header field. Return all fields if empty
|
||||
*
|
||||
* @return string[] the headers or the specified content of the header variable
|
||||
*@see MessageInterface::getHeader()
|
||||
*
|
||||
*/
|
||||
public function getHeader(string $header);
|
||||
|
||||
/**
|
||||
* Returns all headers
|
||||
* @see MessageInterface::getHeaders()
|
||||
*
|
||||
* @return string[][]
|
||||
*/
|
||||
public function getHeaders();
|
||||
|
||||
/**
|
||||
* Check if a specified header exists
|
||||
* @see MessageInterface::hasHeader()
|
||||
*
|
||||
* @param string $field header field
|
||||
*
|
||||
* @return boolean "true" if header exists
|
||||
*/
|
||||
public function inHeader(string $field);
|
||||
|
||||
/**
|
||||
* Returns the headers as an associated array
|
||||
* @see MessageInterface::getHeaders()
|
||||
* @deprecated
|
||||
*
|
||||
* @return string[][] associated header array
|
||||
*/
|
||||
public function getHeaderArray();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSuccess();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getRedirectUrl();
|
||||
|
||||
/**
|
||||
* @see MessageInterface::getBody()
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBody();
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isRedirectUrl();
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
*/
|
||||
public function getErrorNumber();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getError();
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isTimeout();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue