public void ChangeMimeTest() { Config config = new Config(); config.Zone = Zone.ZONE_CN_East; Mac mac = new Mac(AccessKey, SecretKey); BucketManager bucketManager = new BucketManager(mac, config); HttpResult ret = bucketManager.ChangeMime(Bucket, "qiniu.png", "image/x-png"); if (ret.Code != (int)HttpCode.OK) { Assert.Fail("change mime error: " + ret.ToString()); } Console.WriteLine(ret.ToString()); }
public async Task ChangeMimeTest() { var config = new Config { Zone = Zone.ZoneCnEast }; var mac = new Mac(AccessKey, SecretKey); var bucketManager = new BucketManager(mac, config); var ret = await bucketManager.ChangeMime(Bucket, "qiniu.png", "image/x-png"); if (ret.Code != (int)HttpCode.OK) { Assert.True(false, "change mime error: " + ret); } Console.WriteLine(ret.ToString()); }