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
+
23
41
/**
24
42
* Extends MessageInterface::getHeader() to provide request-specific
25
43
* behavior.
26
44
*
27
45
* This method acts exactly like MessageInterface::getHeader(), with
28
46
* one behavioral change: if the Host header is requested, but has
29
- * not been previously set, the method SHOULD attempt to pull the host
47
+ * not been previously set, the method MUST attempt to pull the host
30
48
* segment of the composed URI, if present.
31
49
*
32
50
* @see MessageInterface::getHeader()
@@ -36,6 +54,24 @@ interface RequestInterface extends MessageInterface
36
54
*/
37
55
public function getHeader ($ name );
38
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
+
39
75
/**
40
76
* Retrieves the message's request target.
41
77
*
0 commit comments