How to send a POST request in Go?

The Solution to How to send a POST request in Go? is


You have mostly the right idea, it's just the sending of the form that is wrong. The form belongs in the body of the request.

req, err := http.NewRequest("POST", url, strings.NewReader(form.Encode()))

~ Answered on 2014-06-30 15:10:32


Most Viewed Questions: