send method
- required AwsRequestType type,
- String? service,
- List<
String> signedHeaders = const [], - Map<
String, String> headers = defaultHeaders, - String jsonBody = '',
- String queryPath = '/',
- Map<
String, String> ? queryString, - List<
MapEntry< ? queryStringPairs,String, String> > - bool hashedPayloadIsUnsigned = false,
- bool useNonS3DoubleEncodedCanonicalPath = false,
- Duration? timeout,
- String? endpoint,
Builds, signs, and sends aws http requests.
type: request type GET, POST, PUT, etc
service: aws service you are sending request to
signedHeaders: extra header names (lowercase) to include in the signature.
Always signed: host, x-amz-date. Content-Type is signed when present
on the merged request headers (defaults supply application/x-amz-json-1.1
unless overridden).
headers: any required headers. Any non-default headers included in the signedHeaders must be added here.
jsonBody: the body of the request, formatted as json
queryPath: the aws query path
queryString: the url query string as a Map
timeout: overrides constructor request timeout
endpoint: custom hostname override. Defaults to constructor value, then '{service}.{region}.amazonaws.com' when null.
Implementation
Future<Response> send({
required AwsRequestType type,
String? service,
List<String> signedHeaders = const [],
Map<String, String> headers = defaultHeaders,
String jsonBody = '',
String queryPath = '/',
Map<String, String>? queryString,
List<MapEntry<String, String>>? queryStringPairs,
bool hashedPayloadIsUnsigned = false,
bool useNonS3DoubleEncodedCanonicalPath = false,
Duration? timeout,
String? endpoint,
}) async {
validateRequest(service ?? this.service);
return AwsHttpRequest.send(
awsAccessKey: awsAccessKey,
awsSecretKey: awsSecretKey,
region: region,
type: type,
service: service ?? this.service!,
signedHeaders: signedHeaders,
headers: headers,
jsonBody: jsonBody,
canonicalUri: queryPath,
canonicalQuery: queryString,
canonicalQueryPairs: queryStringPairs,
hashedPayloadIsUnsigned: hashedPayloadIsUnsigned,
useNonS3DoubleEncodedCanonicalPath: useNonS3DoubleEncodedCanonicalPath,
timeout: timeout ?? this.timeout,
endpoint: endpoint ?? this.endpoint,
);
}