Skip to content

Commit

Permalink
close respone when finish
Browse files Browse the repository at this point in the history
  • Loading branch information
kitmanzheng authored May 11, 2018
1 parent bad8f0b commit 4c86f6e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cos_dotnet_sdk/Common/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ public string SendRequest(string url, ref Dictionary<string, object> data, HttpM
using (var s = response.GetResponseStream())
{
var reader = new StreamReader(s, Encoding.UTF8);
return reader.ReadToEnd();
var rsp_data = reader.ReadToEnd();
if (response != null)
{
response.Close();
}
return rsp_data;
}
}
catch (WebException we)
Expand Down

0 comments on commit 4c86f6e

Please sign in to comment.