From 9219471f675758196ba790ddce42847c577107af Mon Sep 17 00:00:00 2001 From: John Date: Wed, 1 Jan 2020 14:26:00 +0800 Subject: [PATCH] improve parameter parsing feature for ghttp.Request --- net/ghttp/ghttp_client_request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ghttp/ghttp_client_request.go b/net/ghttp/ghttp_client_request.go index a79f1a0f2..a032c89f4 100644 --- a/net/ghttp/ghttp_client_request.go +++ b/net/ghttp/ghttp_client_request.go @@ -95,7 +95,7 @@ func (c *Client) Post(url string, data ...interface{}) (resp *ClientResponse, er if json.Valid(paramBytes) { // Auto detecting and setting the post content format: JSON. req.Header.Set("Content-Type", "application/json") - } else if gregex.IsMatchString(`^\w+=.+`, param) { + } else if gregex.IsMatchString(`^[\w\[\]]+=.+`, param) { // If the parameters passed like "name=value", it then uses form type. req.Header.Set("Content-Type", "application/x-www-form-urlencoded") }