From 2af054db74f6ae0202db63f6602746c55656f9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 26 Jul 2021 15:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0uri=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- request/restful.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/request/restful.go b/request/restful.go index 5af4036..cfbb310 100644 --- a/request/restful.go +++ b/request/restful.go @@ -66,7 +66,7 @@ func BuildURL(uriConfig *URIConfig, parameter map[string]interface{}) (string, m finalParameter := make(map[string]interface{}) for field, val := range parameter { if strings.Contains(uri, uriConfig.Left+field+uriConfig.Right) { - uri = strings.ReplaceAll(uri, "{"+field+"}", fmt.Sprintf("%v", val)) + uri = strings.ReplaceAll(uri, uriConfig.Left+field+uriConfig.Right, fmt.Sprintf("%v", val)) if uriConfig.RemoveURIParam { continue }