fsHttpClient function

Client fsHttpClient({
  1. List<InterceptorContract> interceptors = const [],
  2. Duration? requestTimeout,
  3. TimeoutCallback? onRequestTimeout,
  4. RetryPolicy? retryPolicy,
  5. Client? client,
  6. bool captureFirst = true,
})

Creates an HTTP Client which intercepts and captures network events for Fullstory.

Whether Fullstory captures events before or after other interceptors is specified by captureFirst. This may be important if you have interceptors which modify the request or response. In this case, you can configure whether these modifications are captured by Fullstory or not.

This API cannot be used in a background isolate. This is a known issue that will be addressed in a future release.

Implementation

Client fsHttpClient({
  List<InterceptorContract> interceptors = const [],
  Duration? requestTimeout,
  TimeoutCallback? onRequestTimeout,
  RetryPolicy? retryPolicy,
  Client? client,
  bool captureFirst = true,
}) => InterceptedClient.build(
  interceptors: [
    if (captureFirst) FSInterceptor(),
    ...interceptors,
    if (!captureFirst) FSInterceptor(),
  ],
  requestTimeout: requestTimeout,
  onRequestTimeout: onRequestTimeout,
  retryPolicy: retryPolicy,
  client: client,
);