3 * @copyright Copyright (C) 2010-2022, the Friendica project
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 namespace Friendica\Network\HTTPClient\Capability;
24 use Psr\Http\Message\MessageInterface;
27 * Temporary class to map Friendica used variables based on PSR-7 HTTPResponse
29 interface ICanHandleHttpResponses
32 * Gets the Return Code
34 * @return string The Return Code
36 public function getReturnCode();
39 * Returns the Content Type
41 * @return string the Content Type
43 public function getContentType();
48 * @param string $header optional header field. Return all fields if empty
50 * @return string[] the headers or the specified content of the header variable
51 *@see MessageInterface::getHeader()
54 public function getHeader(string $header);
58 * @see MessageInterface::getHeaders()
62 public function getHeaders();
65 * Check if a specified header exists
66 * @see MessageInterface::hasHeader()
68 * @param string $field header field
70 * @return boolean "true" if header exists
72 public function inHeader(string $field);
75 * Returns the headers as an associated array
76 * @see MessageInterface::getHeaders()
79 * @return string[][] associated header array
81 public function getHeaderArray();
86 public function isSuccess();
91 public function getUrl();
96 public function getRedirectUrl();
99 * @see MessageInterface::getBody()
103 public function getBody();
108 public function isRedirectUrl();
113 public function getErrorNumber();
118 public function getError();
123 public function isTimeout();