@@ -17,11 +17,17 @@ interface HttpInterface extends \Magento\Framework\App\ResponseInterface
17
17
*/
18
18
public function setHttpResponseCode ($ code );
19
19
20
+ /**
21
+ * Get HTTP response code
22
+ *
23
+ * @return int
24
+ */
25
+ public function getHttpResponseCode ();
26
+
20
27
/**
21
28
* Set a header
22
29
*
23
- * If $replace is true, replaces any headers already defined with that
24
- * $name.
30
+ * If $replace is true, replaces any headers already defined with that $name.
25
31
*
26
32
* @param string $name
27
33
* @param string $value
@@ -31,6 +37,34 @@ public function setHttpResponseCode($code);
31
37
public function setHeader ($ name , $ value , $ replace = false );
32
38
33
39
/**
40
+ * Get header value by name
41
+ *
42
+ * Returns first found header by passed name.
43
+ * If header with specified name was not found returns false.
44
+ *
45
+ * @param string $name
46
+ * @return \Zend\Http\Header\HeaderInterface|bool
47
+ */
48
+ public function getHeader ($ name );
49
+
50
+ /**
51
+ * Remove header by name from header stack
52
+ *
53
+ * @param string $name
54
+ * @return self
55
+ */
56
+ public function clearHeader ($ name );
57
+
58
+ /**
59
+ * Allow granular setting of HTTP response status code, version and phrase
60
+ *
61
+ * For example, a HTTP response as the following:
62
+ * HTTP 200 1.1 Your response has been served
63
+ * Can be set with the arguments
64
+ * $httpCode = 200
65
+ * $version = 1.1
66
+ * $phrase = 'Your response has been served'
67
+ *
34
68
* @param int|string $httpCode
35
69
* @param null|int|string $version
36
70
* @param null|string $phrase
@@ -39,12 +73,18 @@ public function setHeader($name, $value, $replace = false);
39
73
public function setStatusHeader ($ httpCode , $ version = null , $ phrase = null );
40
74
41
75
/**
76
+ * Append the given string to the response body
77
+ *
42
78
* @param string $value
43
79
* @return self
44
80
*/
45
81
public function appendBody ($ value );
46
82
47
83
/**
84
+ * Set the response body to the given value
85
+ *
86
+ * Any previously set contents will be replaced by the new content.
87
+ *
48
88
* @param string $value
49
89
* @return self
50
90
*/
@@ -53,8 +93,7 @@ public function setBody($value);
53
93
/**
54
94
* Set redirect URL
55
95
*
56
- * Sets Location header and response code. Forces replacement of any prior
57
- * redirects.
96
+ * Sets Location header and response code. Forces replacement of any prior redirects.
58
97
*
59
98
* @param string $url
60
99
* @param int $code
0 commit comments