followRedirects property Null safety

bool followRedirects
read / write

Whether to follow redirects automatically.

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

Automatic redirect will only happen for "GET" and "HEAD" requests and only for the status codes HttpStatus.movedPermanently (301), HttpStatus.found (302), HttpStatus.movedTemporarily (302, alias for HttpStatus.found), HttpStatus.seeOther (303), HttpStatus.temporaryRedirect (307) and HttpStatus.permanentRedirect (308). For HttpStatus.seeOther (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).

Implementation

bool followRedirects = true;