MCPcopy Create free account
hub / github.com/Aur0ra-m/APIKiller / ModifyQueryParam

Function ModifyQueryParam

internal/core/ahttp/ahttpModify.go:180–189  ·  view source on GitHub ↗

ModifyQueryParam @Description: modify url query parameter @param req @param paramName @param newValue @return *http.Request

(req *http.Request, paramName string, newValue string)

Source from the content-addressed store, hash-verified

178// @return *http.Request
179//
180func 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

Callers 2

ModifyParamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected