redirect method

Future<void> redirect(
  1. String url, {
  2. int status = 302,
})

Redirects to another URL (convenience method).

Implementation

Future<void> redirect(String url, {int status = 302}) async {
  _status.setStatus(status);
  _headers.setLocation(url);
  _body.sendEmpty();
  _sent = true;
}