From 807b4dc41a77e3452d3799eec5ba3af0a66188c7 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 1 Sep 2021 02:25:29 +0300 Subject: [PATCH] fix for url query params in url Signed-off-by: Vasiliy Tolstov --- http.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index 5d6177d..579019c 100644 --- a/http.go +++ b/http.go @@ -88,7 +88,13 @@ func newRequest(ctx context.Context, addr string, req client.Request, ct string, return nil, errors.BadRequest("go.micro.client", err.Error()) } - path, nmsg, err := newPathRequest(u.Path, method, body, msg, tags) + var nmsg interface{} + if len(u.Query()) > 0 { + path, nmsg, err = newPathRequest(u.Path+"?"+u.Query().Encode(), method, body, msg, tags) + } else { + path, nmsg, err = newPathRequest(u.Path, method, body, msg, tags) + } + if err != nil { return nil, errors.BadRequest("go.micro.client", err.Error()) }