]> git.mxchange.org Git - friendica.git/blob - src/Network/HTTPClient/Capability/ICanHandleHttpResponses.php
Merge pull request #11129 from urbalazs/copyright-2022
[friendica.git] / src / Network / HTTPClient / Capability / ICanHandleHttpResponses.php
1 <?php
2
3 namespace Friendica\Network\HTTPClient\Capability;
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 ICanHandleHttpResponses
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          *
29          * @param string $header optional header field. Return all fields if empty
30          *
31          * @return string[] the headers or the specified content of the header variable
32          *@see MessageInterface::getHeader()
33          *
34          */
35         public function getHeader(string $header);
36
37         /**
38          * Returns all headers
39          * @see MessageInterface::getHeaders()
40          *
41          * @return string[][]
42          */
43         public function getHeaders();
44
45         /**
46          * Check if a specified header exists
47          * @see MessageInterface::hasHeader()
48          *
49          * @param string $field header field
50          *
51          * @return boolean "true" if header exists
52          */
53         public function inHeader(string $field);
54
55         /**
56          * Returns the headers as an associated array
57          * @see MessageInterface::getHeaders()
58          * @deprecated
59          *
60          * @return string[][] associated header array
61          */
62         public function getHeaderArray();
63
64         /**
65          * @return bool
66          */
67         public function isSuccess();
68
69         /**
70          * @return string
71          */
72         public function getUrl();
73
74         /**
75          * @return string
76          */
77         public function getRedirectUrl();
78
79         /**
80          * @see MessageInterface::getBody()
81          *
82          * @return string
83          */
84         public function getBody();
85
86         /**
87          * @return boolean
88          */
89         public function isRedirectUrl();
90
91         /**
92          * @return integer
93          */
94         public function getErrorNumber();
95
96         /**
97          * @return string
98          */
99         public function getError();
100
101         /**
102          * @return boolean
103          */
104         public function isTimeout();
105 }