FormValueDefault retruns a single parsed form value.
(r *http.Request, name string, def string, postMaxMemory int64, resetBody bool)
| 1777 | |
| 1778 | // FormValueDefault retruns a single parsed form value. |
| 1779 | func FormValueDefault(r *http.Request, name string, def string, postMaxMemory int64, resetBody bool) string { |
| 1780 | if form, has := GetForm(r, postMaxMemory, resetBody); has { |
| 1781 | if v := form[name]; len(v) > 0 { |
| 1782 | return v[0] |
| 1783 | } |
| 1784 | } |
| 1785 | return def |
| 1786 | } |
| 1787 | |
| 1788 | // FormValue returns a single parsed form value by its "name", |
| 1789 | // including both the URL field's query parameters and the POST or PUT form data. |
no test coverage detected
searching dependent graphs…