Skip to content

Commit 5488b5f

Browse files
authored
Cache default httpclient
1 parent 92f16b7 commit 5488b5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CSharpHTTPClient/Client.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace SendGrid.CSharp.HTTP.Client
1414
{
1515
public class Response
1616
{
17+
private static HttpClient _httpClient = new HttpClient();
1718
public HttpStatusCode StatusCode;
1819
public HttpContent Body;
1920
public HttpResponseHeaders Headers;
@@ -194,7 +195,7 @@ private HttpClient BuildHttpClient()
194195
return new HttpClient(httpClientHandler);
195196
}
196197

197-
return new HttpClient();
198+
return _httpClient;
198199
}
199200

200201
/// <summary>

0 commit comments

Comments
 (0)