3 * @copyright Copyright (C) 2010-2023, 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(): string;
39 * Returns the Content Type
41 * @return string the Content Type
43 public function getContentType(): string;
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);
59 * @see MessageInterface::getHeaders()
62 public function getHeaders();
65 * Check if a specified header exists
67 * @see MessageInterface::hasHeader()
68 * @param string $field header field
69 * @return boolean "true" if header exists
71 public function inHeader(string $field): bool;
74 * Returns the headers as an associated array
75 * @see MessageInterface::getHeaders()
78 * @return string[][] associated header array
80 public function getHeaderArray();
85 public function isSuccess(): bool;
90 public function getUrl(): string;
95 public function getRedirectUrl(): string;
100 * @see MessageInterface::getBody()
103 public function getBody();
108 public function isRedirectUrl(): bool;
113 public function getErrorNumber(): int;
118 public function getError(): string;
123 public function isTimeout(): bool;