In Go's http package, how do I get the query string on a POST request?

前端 未结 6 572
滥情空心
滥情空心 2021-01-30 03:59

I\'m using the httppackage from Go to deal with POST request. How can I access and parse the content of the query string from the Requestobject ? I can

6条回答
  •  庸人自扰
    2021-01-30 04:12

    Below is an example:

    value := r.FormValue("field")
    

    for more info. about http package, you could visit its documentation here. FormValue basically returns POST or PUT values, or GET values, in that order, the first one that it finds.

提交回复
热议问题