web_response->setStatus
Sets HTTP response status.
Target
Signature
1web_response->setStatus(code::integer, msg::string)Sets HTTP response status.
web_response->setStatus is called with member syntax on a receiver value. web_response->setStatus belongs at the request or response boundary. Treat visitor input as untrusted, validate before use, and encode values before writing them into HTML.
Parameters
code- Required value of type
integer. Supplycodepositionally unless the signature shows a keyword form. msg- Required value of type
string. Supplymsgpositionally unless the signature shows a keyword form.
Examples
Basic call
1web_response->setStatus(404, 'Not Found')The example belongs near a request or response boundary; validate visitor input before trusting it.