ModifyQueryParam @Description: modify url query parameter @param req @param paramName @param newValue @return *http.Request
(req *http.Request, paramName string, newValue string)
| 178 | // @return *http.Request |
| 179 | // |
| 180 | func ModifyQueryParam(req *http.Request, paramName string, newValue string) *http.Request { |
| 181 | queryParams := req.URL.Query() |
| 182 | if queryParams.Get(paramName) != "" { |
| 183 | |
| 184 | req.URL.RawQuery = strings.Replace(req.URL.RawQuery, paramName+"="+req.URL.Query()[paramName][0], paramName+"="+newValue, 1) |
| 185 | return req |
| 186 | } |
| 187 | |
| 188 | return nil |
| 189 | } |
| 190 | |
| 191 | // |
| 192 | // ModifyPostParam |
no outgoing calls
no test coverage detected