Viewing CORS Rules
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference
You can call ObsClient.getBucketCors to view CORS rules of a bucket. Sample code is as follows:
String endPoint = "https://your-endpoint";
String ak = "*** Provide your Access Key ***";
String sk = "*** Provide your Secret Key ***";
// Create an instance of ObsClient.
ObsClient obsClient = new ObsClient(ak, sk, endPoint);
BucketCors cors = obsClient.getBucketCors("bucketname");
for(BucketCorsRule rule : cors.getRules()){
System.out.println("\t" + rule.getId());
System.out.println("\t" + rule.getMaxAgeSecond());
System.out.println("\t" + rule.getAllowedHeader());
System.out.println("\t" + rule.getAllowedOrigin());
System.out.println("\t" + rule.getAllowedMethod());
System.out.println("\t" + rule.getExposeHeader());
}
Last Article: Setting CORS Rules
Next Article: Deleting CORS Rules
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.