AWSHttpRequest.raw constructor

AWSHttpRequest.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. List<int>? body,
  9. bool? followRedirects,
  10. int? maxRedirects,
})

Creates a "raw", or unprocessed, 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 AWSHttpRequest.new and Uri.

Implementation

AWSHttpRequest.raw({
  required super.method,
  super.scheme,
  required super.host,
  super.port,
  required super.path,
  super.queryParameters,
  super.headers,
  List<int>? body,
  super.followRedirects,
  super.maxRedirects,
})  : bodyBytes = body ?? const [],
      contentLength = body?.length ?? 0,
      super._();