AWSRequest constructor

AWSRequest(
  1. dynamic url,
  2. {String? method,
  3. Map<String, String>? queryParameters,
  4. Map<String, String>? headers,
  5. List<int>? body}
)

Creates a new HTTP request.

Implementation

factory AWSRequest(
  dynamic url, {
  String? method,
  Map<String, String>? queryParameters,
  Map<String, String>? headers,
  List<int>? body,
}) {
  final uri = _fromUriOrString(url);

  return AWSRequest._(
    uri.scheme.isNotEmpty ? uri.scheme : 'https',
    method?.toUpperCase() ?? 'GET',
    uri.host,
    uri.path,
    queryParameters ?? Map<String, String>.from(uri.queryParameters),
    headers != null ? Headers.from(headers) : Headers(),
    body != null ? Uint8List.fromList(body) : Uint8List(0),
  );
}