WebTransportOptions constructor

WebTransportOptions({
  1. String credentials = 'same-origin',
  2. String redirect = 'follow',
  3. String cache = 'default',
  4. String referrerPolicy = 'strict-origin-when-cross-origin',
  5. int maxUploadBytes = 8 * 1024 * 1024,
  6. String? xsrfCookieName,
  7. String xsrfHeaderName = 'x-xsrf-token',
})

Implementation

WebTransportOptions(
    {this.credentials = 'same-origin',
    this.redirect = 'follow',
    this.cache = 'default',
    this.referrerPolicy = 'strict-origin-when-cross-origin',
    this.maxUploadBytes = 8 * 1024 * 1024,
    this.xsrfCookieName,
    this.xsrfHeaderName = 'x-xsrf-token'}) {
  if (!{'omit', 'same-origin', 'include'}.contains(credentials) ||
      !{'follow', 'error', 'manual'}.contains(redirect) ||
      maxUploadBytes < 0) {
    throw ArgumentError('Invalid browser transport options.');
  }
}