While using net/http and net/url for single key value I am getting this error
multiple-value http.PostForm() in single-value context
While using net/http and net/url for single key value I am getting this error
multiple-value http.PostForm() in single-value context
Your error possibly caused by single-value assignment — PostForm (both for Client and Response) returns (resp *Response, err error) (value and an error), so you need to do something like:
resp, err := http.PostForm("http://example.com/form", url.Values{"key": {"Value"}, "id": {"123"}})
while you doing (my suggestion)
resp := http.PostForm("http://example.com/form", url.Values{"key": {"Value"}, "id": {"123"}})