message
[mdref/mdref-http] / http / Message / setResponseStatus.md
1 # http\Message http\Message::setResponseStatus(string $response_status)
2
3 Set the response status phrase.
4 See http\Message::getResponseStatus() and http\Message::setResponseCode().
5
6 ## Params:
7
8 * string $response_status
9 The status phrase.
10
11 ## Returns:
12
13 * http\Message, self.
14 * false, if the message is not of type response.
15
16 ## Notice:
17
18 * E_MESSAGE_TYPE, if the message is not of type response.
19
20
21 ## Example:
22
23 <?php
24 $message = new http\Message;
25 $message->setType(http\Message::TYPE_RESPONSE);
26 $message->setResponseCode(200);
27 $message->setResponseStatus("Ok");
28 echo $message;
29 ?>
30
31 Yields:
32
33 HTTP/1.1 200 Ok