2021-08-20 13:48:13 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Network;
|
|
|
|
|
2021-08-20 13:48:14 -04:00
|
|
|
use Psr\Http\Message\MessageInterface;
|
|
|
|
|
2021-08-20 13:48:13 -04:00
|
|
|
/**
|
|
|
|
* Temporary class to map Friendica used variables based on PSR-7 HTTPResponse
|
|
|
|
*/
|
|
|
|
interface IHTTPResult
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 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
|
2021-08-20 13:48:14 -04:00
|
|
|
* @see MessageInterface::getHeader()
|
2021-08-20 13:48:13 -04:00
|
|
|
*
|
2021-08-20 13:48:14 -04:00
|
|
|
* @param string $header optional header field. Return all fields if empty
|
2021-08-20 13:48:13 -04:00
|
|
|
*
|
|
|
|
* @return string the headers or the specified content of the header variable
|
|
|
|
*/
|
2021-08-20 13:48:14 -04:00
|
|
|
public function getHeader($header);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns all headers
|
|
|
|
* @see MessageInterface::getHeaders()
|
|
|
|
*
|
|
|
|
* @return string[][]
|
|
|
|
*/
|
|
|
|
public function getHeaders();
|
2021-08-20 13:48:13 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if a specified header exists
|
2021-08-20 13:48:14 -04:00
|
|
|
* @see MessageInterface::hasHeader()
|
2021-08-20 13:48:13 -04:00
|
|
|
*
|
|
|
|
* @param string $field header field
|
|
|
|
*
|
|
|
|
* @return boolean "true" if header exists
|
|
|
|
*/
|
|
|
|
public function inHeader(string $field);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the headers as an associated array
|
2021-08-20 13:48:14 -04:00
|
|
|
* @see MessageInterface::getHeaders()
|
|
|
|
* @deprecated
|
2021-08-20 13:48:13 -04:00
|
|
|
*
|
2021-08-20 13:48:14 -04:00
|
|
|
* @return string[][] associated header array
|
2021-08-20 13:48:13 -04:00
|
|
|
*/
|
|
|
|
public function getHeaderArray();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isSuccess();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getUrl();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getRedirectUrl();
|
|
|
|
|
|
|
|
/**
|
2021-08-20 13:48:14 -04:00
|
|
|
* @see MessageInterface::getBody()
|
|
|
|
*
|
2021-08-20 13:48:13 -04:00
|
|
|
* @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();
|
|
|
|
}
|