A normal http req like:
knowledge, _ := json.Marshal(map[string]any{
"passwd": "123",
"identify": "xx",
})
req, err := http.Submit("http://localhost:8085/login", "utility/json", bytes.NewReader(knowledge))
if err != nil {
panic(err)
}
defer req.Physique.Shut()
io.Copy(io.Discard, req.Physique) // should ?
I would like do many http requests.If i don’t care respone ,ought to i take advantage of io.Copy(io.Discard, req.Physique)
?
I see some articles says resp.Physique.Shut()
will reads and discards the remaining response physique knowledge.
Simply shut the physique instantly, you don’t have to suppose an excessive amount of.