AWSStreamedHttpRequest.raw constructor

AWSStreamedHttpRequest.raw({
  1. required AWSHttpMethod method,
  2. String scheme = 'https',
  3. required String host,
  4. int? port,
  5. required String path,
  6. Map<String, Object>? queryParameters,
  7. Map<String, String>? headers,
  8. Stream<List<int>>? body,
  9. int? contentLength,
  10. bool? followRedirects,
  11. int? maxRedirects,
})

Creates a "raw", or unprocessed, streaming HTTP request. Since the Uri constructor will normalize paths by default, this constructor provides an escape hatch for situations when paths are already normalized and further processing could interfere with downstream activities like signing.

If you're unsure, it's likely safe to use AWSStreamedHttpRequest.new and Uri.

@{macro aws_common.aws_http_streamed_request_desc}

Implementation

AWSStreamedHttpRequest.raw({
  required super.method,
  super.scheme,
  required super.host,
  super.port,
  required super.path,
  super.queryParameters,
  super.headers,
  Stream<List<int>>? body,
  int? contentLength,
  super.followRedirects,
  super.maxRedirects,
})  : _body = body ?? const Stream.empty(),
      _contentLength = contentLength,
      super._() {
  _setContentTypeIfProvided(body);
}