followRedirects property

bool followRedirects
read / write

Set this property to true if this request should automatically follow redirects. The default is true.

Automatic redirect will only happen for "GET" and "HEAD" requests and only for the status codes HttpHeaders.MOVED_PERMANENTLY (301), HttpStatus.FOUND (302), HttpStatus.MOVED_TEMPORARILY (302, alias for HttpStatus.FOUND), HttpStatus.SEE_OTHER (303) and HttpStatus.TEMPORARY_REDIRECT (307). For HttpStatus.SEE_OTHER (303) automatic redirect will also happen for "POST" requests with the method changed to "GET" when following the redirect.

All headers added to the request will be added to the redirection request(s). However, any body send with the request will not be part of the redirection request(s).

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-io/HttpClientRequest/followRedirects.html