Query specifies a url parameter name to use to determinate the method to override the POST methos with. Example URL Query string: http://localhost:8080/path?_method=DELETE Defaults to: "_method".
(paramName string)
| 148 | // |
| 149 | // Defaults to: "_method". |
| 150 | func Query(paramName string) Option { |
| 151 | getter := func(w http.ResponseWriter, r *http.Request) string { |
| 152 | return r.URL.Query().Get(paramName) |
| 153 | } |
| 154 | |
| 155 | return Getter(getter) |
| 156 | } |
| 157 | |
| 158 | // Only clears all default or previously registered values |
| 159 | // and uses only the "o" option(s). |