You should absolutely close the WebResponse
- ideally with a using
statement:
using (WebResponse response = request.GetResponse())
{
string x = ReadResponseBody(response);
}
If you don't close the response, the framework doesn't know that you're done with it, and won't reuse the connection. If you do close the response, the connection is returned to a pool for that host, and can be reused.
As there's a connection limit per host (which is configurable), failing to close responses can end up with timeouts or deadlocks, as your process waits for the web response to be finalized instead (which will then behave like closing). You really don't want to have to wait for the garbage collector to happen to notice the response you've already finished with :)