How to parse form array in golang Beego

前端 未结 3 656
南笙
南笙 2021-02-09 09:42

How to parse html form array with Beego.

3条回答
  •  别跟我提以往
    2021-02-09 09:54

    As you can see from the implementation of the FormValue method of the Request, it returns the first value in case of multiple ones: http://golang.org/src/pkg/net/http/request.go?s=23078:23124#L795 It would be better to get the attribute itself r.Form[key] and iterate over all the results manually. I am not sure how Beego works, but just using the raw Request.ParseForm and Request.Form or Request.PostForm maps should do the job. http://golang.org/src/pkg/net/http/request.go?s=1939:6442#L61

提交回复
热议问题