getCorsPolicy method
Returns the cross-origin resource sharing (CORS) configuration information that is set for the container.
To use this operation, you must have permission to perform the
MediaStore:GetCorsPolicy action. By default, the container
owner has this permission and can grant it to others.
May throw ContainerInUseException.
May throw ContainerNotFoundException.
May throw CorsPolicyNotFoundException.
May throw InternalServerError.
Parameter containerName :
The name of the container that the policy is assigned to.
Implementation
Future<GetCorsPolicyOutput> getCorsPolicy({
required String containerName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'MediaStore_20170901.GetCorsPolicy'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ContainerName': containerName,
},
);
return GetCorsPolicyOutput.fromJson(jsonResponse.body);
}