代码修改后的版本,全部提交
This commit is contained in:
34
COSXML/Model/Bucket/PutBucketDomainRequest.cs
Normal file
34
COSXML/Model/Bucket/PutBucketDomainRequest.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
using COSXML.Common;
|
||||
using COSXML.Model.Tag;
|
||||
using COSXML.Network;
|
||||
|
||||
namespace COSXML.Model.Bucket
|
||||
{
|
||||
/// <summary>
|
||||
/// 检索 Bucket 是否存在
|
||||
/// <see cref="https://cloud.tencent.com/document/product/436/7735"/>
|
||||
/// </summary>
|
||||
public sealed class PutBucketDomainRequest : BucketRequest
|
||||
{
|
||||
private DomainConfiguration domain;
|
||||
|
||||
public PutBucketDomainRequest(string bucket, DomainConfiguration domain)
|
||||
: base(bucket)
|
||||
{
|
||||
this.method = CosRequestMethod.PUT;
|
||||
this.domain = domain;
|
||||
this.queryParameters.Add("domain", null);
|
||||
}
|
||||
|
||||
public override Network.RequestBody GetRequestBody()
|
||||
{
|
||||
string content = Transfer.XmlBuilder.BuildDomain(this.domain);
|
||||
byte[] data = Encoding.UTF8.GetBytes(content);
|
||||
ByteRequestBody body = new ByteRequestBody(data);
|
||||
return body;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user