From 774158ff1644cacc279d84115cc8aaeb40589ce3 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期二, 12 一月 2021 11:30:35 +0800
Subject: [PATCH] 调整DoDelete的参数问题
---
httpClient.go | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/httpClient.go b/httpClient.go
index 2cdca21..b4a21c7 100644
--- a/httpClient.go
+++ b/httpClient.go
@@ -140,7 +140,7 @@
}
//鏋勯�燿elete璇锋眰
-func (httpApi HttpClient) DoDeleteRequest(url string, contentType string, body map[string]interface{}, headers map[string]string) ([]byte, error) {
+func (httpApi HttpClient) DoDeleteRequest(url string, contentType string, body map[string]interface{}, params map[string]string, headers map[string]string) ([]byte, error) {
var resultBytes []byte
var bodyJson []byte
if body != nil {
@@ -156,6 +156,14 @@
return resultBytes, err
}
request.Header.Set("Content-type", contentType)
+ //add params
+ q := request.URL.Query()
+ if params != nil {
+ for key, val := range params {
+ q.Add(key, val)
+ }
+ request.URL.RawQuery = q.Encode()
+ }
// add headers
if headers != nil {
for key, val := range headers {
--
Gitblit v1.8.0