BloomRequest constructor
BloomRequest({})
Creates a BloomRequest instance.
body can be a Uint8List, List<int>, String, or a JSON-encodable Map/List.
If rawBody is not provided directly and streamBody is null, it is automatically converted from body.
If streamBody is provided, the request body is treated as a stream and not pre-buffered.
If isSecure is omitted, it is inferred from uri.scheme.
Implementation
BloomRequest({
required this.method,
required this.uri,
this.headers = const {},
Map<String, String>? params,
dynamic body,
Uint8List? rawBody,
Stream<List<int>>? streamBody,
int? maxRequestBodyBytes,
bool? isSecure,
}) : params = params ?? <String, String>{},
_streamBody = streamBody,
_maxRequestBodyBytes = maxRequestBodyBytes,
_rawBody = streamBody != null ? null : (rawBody ?? _convertBody(body)),
isSecure = isSecure ?? (uri.scheme.toLowerCase() == 'https');