You are here

public function ResponseInterface::setStatusCode in RESTful 7.2

Sets the response status code.

Parameters

int $code: HTTP status code

mixed $text: HTTP status text

If the status text is NULL it will be automatically populated for the known status codes and left empty otherwise.

Throws

UnprocessableEntityException When the HTTP status code is not valid

1 method overrides ResponseInterface::setStatusCode()
Response::setStatusCode in src/Http/Response.php
Sets the response status code.

File

src/Http/ResponseInterface.php, line 95
Contains \Drupal\restful\Http\ResponseInterface.

Class

ResponseInterface

Namespace

Drupal\restful\Http

Code

public function setStatusCode($code, $text = NULL);