(w *ResponseWriter, param string)
| 158 | } |
| 159 | |
| 160 | func (r *Request) BoolFromQuery(w *ResponseWriter, param string) (bool, bool) { |
| 161 | s := r.URL.Query().Get(param) |
| 162 | if s == "" { |
| 163 | return false, true |
| 164 | } |
| 165 | b, err := strconv.ParseBool(s) |
| 166 | if err != nil { |
| 167 | w.Error(srverr.ErrInvalid("invalid query param %q: %w", s, err)) |
| 168 | return false, false |
| 169 | } |
| 170 | return b, true |
| 171 | } |
| 172 | |
| 173 | func (r *Request) Unmarshal(w *ResponseWriter, body any, templates ...any) bool { |
| 174 | format, ok := r.format(w, DefaultFormat) |
no test coverage detected