Fix IHTTPResult::getHeader/s()
[friendica.git/.git] / src / Network / IHTTPResult.php
1 <?php
2
3 namespace Friendica\Network;
4
5 use Psr\Http\Message\MessageInterface;
6
7 /**
8  * Temporary class to map Friendica used variables based on PSR-7 HTTPResponse
9  */
10 interface IHTTPResult
11 {
12         /**
13          * Gets the Return Code
14          *
15          * @return string The Return Code
16          */
17         public function getReturnCode();
18
19         /**
20          * Returns the Content Type
21          *
22          * @return string the Content Type
23          */
24         public function getContentType();
25
26         /**
27          * Returns the headers
28          * @see MessageInterface::getHeader()
29          *
30          * @param string $header optional header field. Return all fields if empty
31          *
32          * @return string the headers or the specified content of the header variable
33          */
34         public function getHeader($header);
35
36         /**
37          * Returns all headers
38          * @see MessageInterface::getHeaders()
39          *
40          * @return string[][]
41          */
42         public function getHeaders();
43
44         /**
45          * Check if a specified header exists
46          * @see MessageInterface::hasHeader()
47          *
48          * @param string $field header field
49          *
50          * @return boolean "true" if header exists
51          */
52         public function inHeader(string $field);
53
54         /**
55          * Returns the headers as an associated array
56          * @see MessageInterface::getHeaders()
57          * @deprecated
58          *
59          * @return string[][] associated header array
60          */
61         public function getHeaderArray();
62
63         /**
64          * @return bool
65          */
66         public function isSuccess();
67
68         /**
69          * @return string
70          */
71         public function getUrl();
72
73         /**
74          * @return string
75          */
76         public function getRedirectUrl();
77
78         /**
79          * @see MessageInterface::getBody()
80          *
81          * @return string
82          */
83         public function getBody();
84
85         /**
86          * @return array
87          */
88         public function getInfo();
89
90         /**
91          * @return boolean
92          */
93         public function isRedirectUrl();
94
95         /**
96          * @return integer
97          */
98         public function getErrorNumber();
99
100         /**
101          * @return string
102          */
103         public function getError();
104
105         /**
106          * @return boolean
107          */
108         public function isTimeout();
109 }