status property

int get status

HTTP status code.

Returns the HTTP status code of the response.

Implementation

int get status => _status;
set status (int value)

Sets the HTTP status code

Default status is 200 "OK", if this method is not used to set it to a different value.

The HTTP status code cannot be changed after the production of the response has started. Attempts to change it will result in a StateError exception.

Implementation

set status(int value) {
  if (_headersOutputted) {
    throw StateError('Header already outputted');
  }
  _status = value;
}