RestDataProvider<T> constructor

RestDataProvider<T>({
  1. required String urlBuilder(
    1. RouteDataContext context
    ),
  2. required JsonEntityMapper<T> mapper,
  3. Client? client,
  4. Map<String, String> headers = const {},
  5. Duration timeout = const Duration(seconds: 10),
  6. int maxResponseSizeBytes = 5 * 1024 * 1024,
  7. int maxRetries = 2,
  8. String entityTag = 'rest_api',
  9. SsrfGuard ssrfGuard = const SsrfGuard(),
})

Implementation

RestDataProvider({
  required this.urlBuilder,
  required this.mapper,
  http.Client? client,
  this.headers = const {},
  this.timeout = const Duration(seconds: 10),
  this.maxResponseSizeBytes = 5 * 1024 * 1024, // 5MB limit
  this.maxRetries = 2,
  this.entityTag = 'rest_api',
  this.ssrfGuard = const SsrfGuard(),
}) : client =
         client ?? ssrfGuard.createPinnedClient(connectionTimeout: timeout);