staticSend static method
Future<Response>
staticSend({
- required String awsAccessKey,
- required String awsSecretKey,
- required String region,
- required String service,
- required AwsRequestType type,
- required Future<
Response> mockFunction(- Request
- 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 = const Duration(seconds: 10),
- String? endpoint,
Statically Builds, signs, and mocks an aws http request.
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
Implementation
static Future<Response> staticSend({
required String awsAccessKey,
required String awsSecretKey,
required String region,
required String service,
required AwsRequestType type,
required Future<Response> Function(Request) mockFunction,
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 = const Duration(seconds: 10),
String? endpoint,
}) async {
return AwsHttpRequest.send(
awsAccessKey: awsAccessKey,
awsSecretKey: awsSecretKey,
region: region,
type: type,
service: service,
signedHeaders: signedHeaders,
headers: headers,
jsonBody: jsonBody,
canonicalUri: queryPath,
canonicalQuery: queryString,
canonicalQueryPairs: queryStringPairs,
hashedPayloadIsUnsigned: hashedPayloadIsUnsigned,
useNonS3DoubleEncodedCanonicalPath: useNonS3DoubleEncodedCanonicalPath,
timeout: timeout,
endpoint: endpoint,
mockRequest: true,
mockFunction: mockFunction,
);
}