So, I've just started with Go and I'm trying to learn HTTP
package. I found this program on the internet
headers := make(map[string]string)
headers["authorization"] = "1432536546" //the auhorization string
url := "anUrl\"
req, err := http.NewRequest("DELETE", url, headers)
if err != nil {
panic(err)
}
But it is wrong, as it appears you can't use maps like this as they don't implement the io.Reader
interface:
cannot use headers (type map[string]string) as type io.Reader in argument to http.NewRequest:
map[string]string does not implement io.Reader (missing Read method)
This is one of the first code snippets I tried, I actually got it from what I thought to be a reliable source, and obviously it doesn't compile. Go looks pretty interesting, but it has pretty much zero tutorials and useful documentation... Please help me, what is the right way to do it?