FetchClient constructor

FetchClient({
  1. RequestMode mode = RequestMode.noCors,
  2. RequestCredentials credentials = RequestCredentials.sameOrigin,
  3. RequestCache cache = RequestCache.byDefault,
  4. String referrer = '',
  5. RequestReferrerPolicy referrerPolicy = RequestReferrerPolicy.strictOriginWhenCrossOrigin,
  6. RedirectPolicy redirectPolicy = RedirectPolicy.alwaysFollow,
  7. bool streamRequests = false,
})

Create new HTTP client based on Fetch API.

Implementation

FetchClient({
  this.mode = RequestMode.noCors,
  this.credentials = RequestCredentials.sameOrigin,
  this.cache = RequestCache.byDefault,
  this.referrer = '',
  this.referrerPolicy = RequestReferrerPolicy.strictOriginWhenCrossOrigin,
  this.redirectPolicy = RedirectPolicy.alwaysFollow,
  this.streamRequests = false,
});