Advertisement
Guest User

Untitled

a guest
Oct 11th, 2016
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <form method="POST" action="mygo">
  2. <input type=hidden name="emails[]" value="email1@email.com">
  3. <input type=hidden name="emails[]" value="email2@email.com">
  4. <input type=hidden name="emails[]" value="email3@email.com">
  5. </form>
  6.  
  7. <form method="POST" action="mygo">
  8. <input type=hidden name="emails" value="email1@email.com">
  9. <input type=hidden name="emails" value="email2@email.com">
  10. <input type=hidden name="emails" value="email3@email.com">
  11. </form>
  12.  
  13. func main() {
  14. // ...
  15. router.POST("mygo",parseFunc)
  16. }
  17.  
  18. func mygo(c *gin.Context) {
  19. c.Request.ParseForm()
  20. log.Printf("%v",c.Request.PostForm["emails"]) // ""
  21. log.Printf("%v",c.PostForm("emails") // "email3@email.com"
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement