API | 操作名 | 操作描述 |
预请求跨域配置 | 用预请求来确认是否可以发送真正的跨域请求 |
try{string bucket = "examplebucket-1250000000"; //存储桶,格式:BucketName-APPIDstring key = "exampleobject"; //对象键string origin = "http://cloud.tencent.com";string accessMthod = "PUT";OptionObjectRequest request = new OptionObjectRequest(bucket, key, origin, accessMthod);//执行请求OptionObjectResult result = cosXml.OptionObject(request);//请求成功Console.WriteLine(result.GetResultInfo());}catch (COSXML.CosException.CosClientException clientEx){//请求失败Console.WriteLine("CosClientException: " + clientEx);}catch (COSXML.CosException.CosServerException serverEx){//请求失败Console.WriteLine("CosServerException: " + serverEx.GetInfo());}
本页内容是否解决了您的问题?