|
20 | 20 | */
|
21 | 21 | interface RequestInterface extends MessageInterface
|
22 | 22 | {
|
| 23 | + /** |
| 24 | + * Extends MessageInterface::getHeaders() to provide request-specific |
| 25 | + * behavior. |
| 26 | + * |
| 27 | + * Retrieves all message headers. |
| 28 | + * |
| 29 | + * This method acts exactly like MessageInterface::getHeaders(), with one |
| 30 | + * behavioral change: if the Host header has not been previously set, the |
| 31 | + * method MUST attempt to pull the host segment of the composed URI, if |
| 32 | + * present. |
| 33 | + * |
| 34 | + * @see MessageInterface::getHeaders() |
| 35 | + * @see UriInterface::getHost() |
| 36 | + * @return array Returns an associative array of the message's headers. Each |
| 37 | + * key MUST be a header name, and each value MUST be an array of strings. |
| 38 | + */ |
| 39 | + public function getHeaders(); |
| 40 | + |
| 41 | + /** |
| 42 | + * Extends MessageInterface::getHeader() to provide request-specific |
| 43 | + * behavior. |
| 44 | + * |
| 45 | + * This method acts exactly like MessageInterface::getHeader(), with |
| 46 | + * one behavioral change: if the Host header is requested, but has |
| 47 | + * not been previously set, the method MUST attempt to pull the host |
| 48 | + * segment of the composed URI, if present. |
| 49 | + * |
| 50 | + * @see MessageInterface::getHeader() |
| 51 | + * @see UriInterface::getHost() |
| 52 | + * @param string $name Case-insensitive header field name. |
| 53 | + * @return string |
| 54 | + */ |
| 55 | + public function getHeader($name); |
| 56 | + |
| 57 | + /** |
| 58 | + * Extends MessageInterface::getHeaderLines() to provide request-specific |
| 59 | + * behavior. |
| 60 | + * |
| 61 | + * Retrieves a header by the given case-insensitive name as an array of strings. |
| 62 | + * |
| 63 | + * This method acts exactly like MessageInterface::getHeaderLines(), with |
| 64 | + * one behavioral change: if the Host header is requested, but has |
| 65 | + * not been previously set, the method MUST attempt to pull the host |
| 66 | + * segment of the composed URI, if present. |
| 67 | + * |
| 68 | + * @see MessageInterface::getHeaderLines() |
| 69 | + * @see UriInterface::getHost() |
| 70 | + * @param string $name Case-insensitive header field name. |
| 71 | + * @return string[] |
| 72 | + */ |
| 73 | + public function getHeaderLines($name); |
| 74 | + |
23 | 75 | /**
|
24 | 76 | * Retrieves the message's request target.
|
25 | 77 | *
|
|
0 commit comments