Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr committed Aug 16, 2023
1 parent 3ab8768 commit ff8934d
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class NRWebRequestClient : HttpClientBase
{
private readonly IConfiguration _configuration;
private HttpWebRequest _httpWebRequest;
private IHttpRequest _request;

private Func<Uri, HttpWebRequest> _getHttpWebRequestFunc = uri => (HttpWebRequest)WebRequest.Create(uri);

Expand All @@ -25,8 +24,6 @@ public override async Task<IHttpResponse> SendAsync(IHttpRequest request)
{
try
{
_request = request;

_httpWebRequest = _getHttpWebRequestFunc(request.Uri);

// If a null assignment is made it will bypass the default (IE) proxy settings
Expand All @@ -39,7 +36,7 @@ public override async Task<IHttpResponse> SendAsync(IHttpRequest request)

_httpWebRequest.KeepAlive = true;
_httpWebRequest.Timeout = (int)request.Timeout.TotalMilliseconds;
_httpWebRequest.ContentType = "application/octet-stream";
_httpWebRequest.ContentType = request.Content.ContentType;
_httpWebRequest.UserAgent = $"NewRelic-DotNetAgent/{AgentInstallConfiguration.AgentVersion}";
_httpWebRequest.Method = _configuration.PutForDataSend ? "PUT" : "POST";

Expand Down

0 comments on commit ff8934d

Please sign in to comment.