# I get no data from Elastic via asp.net core

**URL:** <https://discuss.elastic.co/t/i-get-no-data-from-elastic-via-asp-net-core/323515>\
**Category:** Elasticsearch\
**Created:** [January 19, 2023, 12:54pm UTC](https://discuss.elastic.co/t/i-get-no-data-from-elastic-via-asp-net-core/323515 "2023-01-19T12:54:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fozgul](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@fozgul](https://discuss.elastic.co/u/fozgul)\
**Post date:** [January 19, 2023, 12:54pm UTC](https://discuss.elastic.co/t/i-get-no-data-from-elastic-via-asp-net-core/323515/1 "2023-01-19T12:54:57Z")

</div>

My Elastic server(7.16.2) is running on an on-prem server with certain Ip. (Free version)  
I have the following setup for client creation in [asp.net](http://asp.net) core:  
var pool = new SingleNodeConnectionPool(new Uri("[http://usernamepassword@Server:9200](http://usernamepassword@Server:9200)"));  
var settings = new ConnectionSettings(pool)  
.DefaultIndex("books");  
var client = new ElasticClient(settings);  
builder.Services.AddSingleton(client);

When I send a request through the client in a Controller class, I get no data and no exception either.  
When I do the same kind of request via curl in the Elastic server, I get data. What is wrong with my setup in the [asp.net](http://asp.net) core?  
I would be glad if anybody send me a reply on the topic.  
Best regards,

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 16, 2023, 12:55pm UTC](https://discuss.elastic.co/t/i-get-no-data-from-elastic-via-asp-net-core/323515/2 "2023-02-16T12:55:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
