]> git.mxchange.org Git - friendica.git/blob - src/Network/HTTPClient/Capability/ICanHandleHttpResponses.php
Fix all license header & be less aggressive
[friendica.git] / src / Network / HTTPClient / Capability / ICanHandleHttpResponses.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2022, the Friendica project
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
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.
11  *
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.
16  *
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/>.
19  *
20  */
21
22 namespace Friendica\Network\HTTPClient\Capability;
23
24 use Psr\Http\Message\MessageInterface;
25
26 /**
27  * Temporary class to map Friendica used variables based on PSR-7 HTTPResponse
28  */
29 interface ICanHandleHttpResponses
30 {
31         /**
32          * Gets the Return Code
33          *
34          * @return string The Return Code
35          */
36         public function getReturnCode();
37
38         /**
39          * Returns the Content Type
40          *
41          * @return string the Content Type
42          */
43         public function getContentType();
44
45         /**
46          * Returns the headers
47          *
48          * @param string $header optional header field. Return all fields if empty
49          *
50          * @return string[] the headers or the specified content of the header variable
51          *@see MessageInterface::getHeader()
52          *
53          */
54         public function getHeader(string $header);
55
56         /**
57          * Returns all headers
58          * @see MessageInterface::getHeaders()
59          *
60          * @return string[][]
61          */
62         public function getHeaders();
63
64         /**
65          * Check if a specified header exists
66          * @see MessageInterface::hasHeader()
67          *
68          * @param string $field header field
69          *
70          * @return boolean "true" if header exists
71          */
72         public function inHeader(string $field);
73
74         /**
75          * Returns the headers as an associated array
76          * @see MessageInterface::getHeaders()
77          * @deprecated
78          *
79          * @return string[][] associated header array
80          */
81         public function getHeaderArray();
82
83         /**
84          * @return bool
85          */
86         public function isSuccess();
87
88         /**
89          * @return string
90          */
91         public function getUrl();
92
93         /**
94          * @return string
95          */
96         public function getRedirectUrl();
97
98         /**
99          * @see MessageInterface::getBody()
100          *
101          * @return string
102          */
103         public function getBody();
104
105         /**
106          * @return boolean
107          */
108         public function isRedirectUrl();
109
110         /**
111          * @return integer
112          */
113         public function getErrorNumber();
114
115         /**
116          * @return string
117          */
118         public function getError();
119
120         /**
121          * @return boolean
122          */
123         public function isTimeout();
124 }