MCPcopy Create free account
hub / github.com/prest/prest / extractQueryParameters

Function extractQueryParameters

controllers/script.go:104–112  ·  view source on GitHub ↗

extractQueryParameters gets from the given request the query parameters and populate the provided templateData accordingly.

(rq *http.Request, templateData map[string]interface{})

Source from the content-addressed store, hash-verified

102// extractQueryParameters gets from the given request the query parameters and populate the provided templateData
103// accordingly.
104func extractQueryParameters(rq *http.Request, templateData map[string]interface{}) {
105 for key, value := range rq.URL.Query() {
106 if len(value) == 1 {
107 templateData[key] = value[0]
108 continue
109 }
110 templateData[key] = value
111 }
112}

Callers 2

ExecuteScriptQueryMethod · 0.85

Calls 1

QueryMethod · 0.65

Tested by 1