shouldUseDefaultClient method
Returns true when request should be sent through defaultClient.
The constructor callback has the highest priority. If no callback is provided, the built-in minimal routing rules are used.
Override this method in a subclass if your project needs custom routing based on request method, URL, headers, or body content.
Implementation
bool shouldUseDefaultClient(http.BaseRequest request) {
final decision = _useDefaultClientWhen;
if (decision != null) {
return decision(request);
}
if (request is http.StreamedRequest) {
return true;
}
if (_isGeminiStreamingRequest(request)) {
return true;
}
if (_isKnownJsonStreamingRequest(request)) {
return true;
}
return false;
}