PutBucketRefererRequest.cs 947 B

123456789101112131415161718192021222324252627282930313233343536
  1. using COSXML.Common;
  2. using COSXML.Model.Tag;
  3. using COSXML.Network;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. namespace COSXML.Model.Bucket
  8. {
  9. /// <summary>
  10. /// 设置 Bucket 防盗链
  11. /// <see href="https://cloud.tencent.com/document/product/436/32492"/>
  12. /// </summary>
  13. public sealed class PutBucketRefererRequest : BucketRequest
  14. {
  15. public RefererConfiguration refererConfiguration;
  16. public PutBucketRefererRequest(string bucket) : base(bucket)
  17. {
  18. this.method = CosRequestMethod.PUT;
  19. this.queryParameters.Add("referer", null);
  20. }
  21. public void SetRefererConfiguration(RefererConfiguration refererConfiguration) {
  22. this.refererConfiguration = refererConfiguration;
  23. }
  24. public override Network.RequestBody GetRequestBody()
  25. {
  26. return GetXmlRequestBody(refererConfiguration);
  27. }
  28. }
  29. }