post - How to parse html forms in the Go Iris framework? -
sorry if question bit basic, how can parse form inputs in go iris framework? here form using
<form action="/" method="post"> username:<input type="text" name="username"> password:<input type="password" name="password"> <input type="submit" value="login"> </form>
here route , controller respectively
iris.post("/", testcontroller) func testcontroller(c *iris.context){ username := c.form.get("username")//doesn't work password := c.form.get("password")//doesn't work }
how retrieve values in post request after form has been submitted, thanks
based off example on iris
github page try c.postvalue("username")
. code have may work think need capitalize variable names. in html template can see name
value lowercased, context more going off variable names left of actual html username
.
Comments
Post a Comment