redirect method

Future redirect (
  1. Uri location,
  2. {int status = HttpStatus.movedTemporarily}
)

Respond with a redirect to location.

The URI in location should be absolute, but there are no checks to enforce that.

By default the HTTP status code HttpStatus.movedTemporarily (302) is used for the redirect, but an alternative one can be specified using the status argument.

This method will also call close, and the returned future is the future returned by close.

Implementation

Future redirect(Uri location, {int status = HttpStatus.movedTemporarily});

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-io/HttpResponse/redirect.html