71ff8f05f1faa2148480eb8c7af26686088f4a90
[mdref/mdref-http] / http / Message / setResponseCode.md
1 # http\Message http\Message::setResponseCode(int $response_code[, bool $strict = true])
2
3 Set the response status code.
4 See http\Message::getResponseCode() and http\Message::setResponseStatus().
5
6 > **Note:** This method also resets the response status phrase to the default for that code.
7
8 ## Params:
9
10 * int $response_code
11 The response code.
12 * Optional bool $strict = true
13 Whether to check that the response code is between 100 and 599 inclusive.
14
15 ## Returns:
16
17 * http\Message, self.
18
19 ## Throws:
20
21 * http\Exception\InvalidArgumentException
22 * http\Exception\BadMethodCallException