How to get the value of an input element by name when POST.
<form action="#" method="post">
<input type="text" name="name" placeholder="name">
<input type="submit" value="Submit">
</form>
I want to get name's value.
import jester
routes:
get "/":
resp readFile("./src/views/index.html")
While @ynfle's answer can work, there's a far simpler way to do that in Jester:
import jester
routes:
get "/":
resp readFile("./src/views/index.html")
post "/":
# get "name" field from the post body
let name = @"name"
echo name
resp Http200