setStatusCode method

void setStatusCode(
  1. int statusCode, {
  2. String? responseBody,
})

Sets the response status code.

When responseBody is provided, it will be used as the response body instead of the rendered html.

Implementation

void setStatusCode(int statusCode, {String? responseBody}) {
  _binding
    ..responseStatusCode = statusCode
    ..responseErrorBody = responseBody;
}