@@ -163,8 +163,7 @@ func (me *CosService) TencentCosPutBucket(ctx context.Context, bucket string, op
163163 return
164164 }
165165
166- body , _ := response .Response .Request .GetBody ()
167- resp , _ := json .Marshal (body )
166+ resp , _ := json .Marshal (response .Response .Body )
168167
169168 log .Printf ("[DEBUG]%s api[%s] success, request body [%s], response body [%s], baseUrl %s\n " ,
170169 logId , "put bucket" , req , resp , client .BaseURL .BucketURL )
@@ -214,8 +213,7 @@ func (me *CosService) TencentCosPutBucketACL(
214213 return
215214 }
216215
217- body , _ := response .Response .Request .GetBody ()
218- resp , _ := json .Marshal (body )
216+ resp , _ := json .Marshal (response .Response .Body )
219217
220218 log .Printf ("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n " ,
221219 logId , "PutBucketACL" , req , resp )
@@ -1214,8 +1212,7 @@ func (me *CosService) PutBucketPullOrigin(ctx context.Context, bucket string, ru
12141212 ratelimit .Check ("PutBucketPullOrigin" )
12151213 response , err := me .client .UseTencentCosClient (bucket ).Bucket .PutOrigin (ctx , opt )
12161214 req , _ := json .Marshal (opt )
1217- body , _ := response .Response .Request .GetBody ()
1218- resp , _ := json .Marshal (body )
1215+ resp , _ := json .Marshal (response .Response .Body )
12191216
12201217 defer func () {
12211218 if errRet != nil {
@@ -1247,8 +1244,7 @@ func (me *CosService) DeleteBucketPullOrigin(ctx context.Context, bucket string)
12471244
12481245 ratelimit .Check ("DeleteBucketPullOrigin" )
12491246 response , err := me .client .UseTencentCosClient (bucket ).Bucket .DeleteOrigin (ctx )
1250- body , _ := response .Response .Request .GetBody ()
1251- resp , _ := json .Marshal (body )
1247+ resp , _ := json .Marshal (response .Response .Body )
12521248
12531249 if err != nil {
12541250 errRet = fmt .Errorf ("[DeleteBucketPullOrigin] error: %s, bucket: %s" , err .Error (), bucket )
@@ -1294,8 +1290,7 @@ func (me *CosService) GetBucketOriginDomain(ctx context.Context, bucket string)
12941290 rules = append (rules , item )
12951291 }
12961292
1297- body , _ := response .Response .Request .GetBody ()
1298- resp , _ := json .Marshal (body )
1293+ resp , _ := json .Marshal (response .Response .Body )
12991294
13001295 log .Printf ("[DEBUG]%s api[%s] success, request body response body [%s]\n " ,
13011296 logId , "GetBucketOriginDomain" , resp )
@@ -1312,8 +1307,7 @@ func (me *CosService) PutBucketOriginDomain(ctx context.Context, bucket string,
13121307 ratelimit .Check ("PutBucketOriginDomain" )
13131308 response , err := me .client .UseTencentCosClient (bucket ).Bucket .PutDomain (ctx , opt )
13141309 req , _ := json .Marshal (opt )
1315- body , _ := response .Response .Request .GetBody ()
1316- resp , _ := json .Marshal (body )
1310+ resp , _ := json .Marshal (response .Response .Body )
13171311
13181312 defer func () {
13191313 if errRet != nil {
@@ -1345,8 +1339,7 @@ func (me *CosService) DeleteBucketOriginDomain(ctx context.Context, bucket strin
13451339
13461340 ratelimit .Check ("DeleteBucketOriginDomain" )
13471341 response , err := me .client .UseTencentCosClient (bucket ).Bucket .DeleteDomain (ctx )
1348- body , _ := response .Response .Request .GetBody ()
1349- resp , _ := json .Marshal (body )
1342+ resp , _ := json .Marshal (response .Response .Body )
13501343
13511344 if err != nil {
13521345 errRet = fmt .Errorf ("[DeleteBucketOriginDomain] error: %s, bucket: %s" , err .Error (), bucket )
@@ -1376,8 +1369,7 @@ func (me *CosService) GetBucketReplication(ctx context.Context, bucket string) (
13761369 return
13771370 }
13781371
1379- body , _ := response .Response .Request .GetBody ()
1380- resp , _ := json .Marshal (body )
1372+ resp , _ := json .Marshal (response .Response .Body )
13811373
13821374 if err != nil {
13831375 errRet = err
@@ -1410,8 +1402,7 @@ func (me *CosService) PutBucketReplication(ctx context.Context, bucket string, r
14101402 ratelimit .Check ("PutBucketReplication" )
14111403 response , err := me .client .UseTencentCosClient (bucket ).Bucket .PutBucketReplication (ctx , option )
14121404
1413- body , _ := response .Response .Request .GetBody ()
1414- resp , _ := json .Marshal (body )
1405+ resp , _ := json .Marshal (response .Response .Body )
14151406
14161407 if err != nil {
14171408 errRet = err
@@ -1436,8 +1427,7 @@ func (me *CosService) DeleteBucketReplication(ctx context.Context, bucket string
14361427 ratelimit .Check ("DeleteBucketReplication" )
14371428 response , err := me .client .UseTencentCosClient (bucket ).Bucket .DeleteBucketReplication (ctx )
14381429
1439- body , _ := response .Response .Request .GetBody ()
1440- resp , _ := json .Marshal (body )
1430+ resp , _ := json .Marshal (response .Response .Body )
14411431
14421432 if err != nil {
14431433 errRet = err
@@ -1474,8 +1464,7 @@ func (me *CosService) DescribeCosBucketDomainCertificate(ctx context.Context, ce
14741464 }()
14751465
14761466 result , response , err := me .client .UseTencentCosClient (bucket ).Bucket .GetDomainCertificate (ctx , option )
1477- body , _ := response .Response .Request .GetBody ()
1478- resp , _ := json .Marshal (body )
1467+ resp , _ := json .Marshal (response .Response .Body )
14791468 if response .StatusCode == 404 {
14801469 log .Printf ("[WARN]%s, api[%s] returns %d" , logId , "GetDomainCertificate" , response .StatusCode )
14811470 return
@@ -1517,14 +1506,13 @@ func (me *CosService) DeleteCosBucketDomainCertificate(ctx context.Context, cert
15171506 ratelimit .Check ("DeleteDomainCertificate" )
15181507 response , err := me .client .UseTencentCosClient (bucket ).Bucket .DeleteDomainCertificate (ctx , option )
15191508
1520- body , _ := response .Response .Request .GetBody ()
1521- resp , _ := json .Marshal (body )
1522-
15231509 if err != nil {
15241510 errRet = err
15251511 return err
15261512 }
15271513
1514+ resp , _ := json .Marshal (response .Response .Body )
1515+
15281516 log .Printf ("[DEBUG]%s api[%s] success, option [%s], response body [%s]\n " ,
15291517 logId , "DeleteDomainCertificate" , option , resp )
15301518
0 commit comments