Quantcast
Channel: Why is response body in golang is a readCloser? - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Volker for Why is response body in golang is a readCloser?

The Body is a ReadCloser. Why is that?Because you can Read from it and you have to Close it once you are done.The main question is: Does http package read header and body at the same time and...

View Article



Why is response body in golang is a readCloser?

I'm wondering how http package in golang works. I can see that the body of http response is like this:type Response struct { StatusCode int Header Header Body io.ReadCloser}The Body is a ReadCloser....

View Article
Browsing all 2 articles
Browse latest View live


Latest Images