# .NET An error occurred while sending the request

**URL:** <https://discuss.elastic.co/t/net-an-error-occurred-while-sending-the-request/296473>\
**Category:** APM\
**Tags:** dotnet, language-clients\
**Created:** [February 7, 2022, 1:34pm UTC](https://discuss.elastic.co/t/net-an-error-occurred-while-sending-the-request/296473 "2022-02-07T13:34:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pancar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pancar/32/101469_2.png) [@pancar](https://discuss.elastic.co/u/pancar)\
**Post date:** [February 11, 2022, 7:01am UTC](https://discuss.elastic.co/t/net-an-error-occurred-while-sending-the-request/296473/2 "2022-02-11T07:01:34Z")

</div>

After a while, i found a document of yours about http request.

> **[HTTP configuration options | APM .NET Agent Reference \[1.12\] | Elastic](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-http.html#config-capture-body)**

in web.config my keys looks like this. Even though i added capturebody as equal all i still get same error. I would appreciate the help.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/c/bca6a0ea29b621054b16d94f6dbf87013ba0244b.png)

[2022-02-11 09:56:45.222 +03:00][Error] - {CentralConfigurationFetcher} Exception was thrown while fetching configuration from APM Server and parsing it. ETag: `<null>'. URL: `[https://apm-server](https://apm-server).\*\*\*\*.com.tr/config/v1/agents?service.name=ATM'. Apm Server base URL: `https://apm-server. ****.com.tr/'. WaitInterval: 5m. dbgIterationsCount: 1. +-> Request: Method: GET, RequestUri: 'https://apm-server.burgan.com.tr/config/v1/agents?service.name=ATM', Version: 1.1, Content: <null>, Headers: { User-Agent: apm-agent-dotnet/1.14.0+a04553cf41c2bc212d866c6031f087273edb9a8b User-Agent: (ATM) User-Agent: System.Net.Http/4.8.3752.0 User-Agent: .NET_Framework/4.8.4420.0 Authorization: [REDACTED] } +-> Response: N/A +-> Response body [length: N/A]: N/A+-> Exception: System.Net.Http.HttpRequestException: An error occurred while sending the request. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Elastic.Apm.BackendComm.CentralConfig.CentralConfigurationFetcher.<FetchConfigHttpResponseImplAsync>d__17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Elastic.Apm.Helpers.AgentTimerExtensions.<TryAwaitOrTimeout>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Elastic.Apm.Helpers.AgentTimerExtensions.<TryAwaitOrTimeout>d__1`1.MoveNext()  
--- End of stack trace from previous location where exception was thrown ---  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at Elastic.Apm.Helpers.AgentTimerExtensions.d\_\_3`1.MoveNext()  
--- End of stack trace from previous location where exception was thrown ---  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at Elastic.Apm.BackendComm.CentralConfig.CentralConfigurationFetcher.d\_\_18.MoveNext()  
--- End of stack trace from previous location where exception was thrown ---  
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)  
at Elastic.Apm.BackendComm.CentralConfig.CentralConfigurationFetcher.d\_\_15.MoveNext()

---

_[View the full topic](https://discuss.elastic.co/t/net-an-error-occurred-while-sending-the-request/296473)._
