C# sending a get request with a body to ElasticSearch

I'm trying to return the data from an existing visualization, called from an external source (written in C#). This can be done in Postman using a GET with a body request (this body copied from the request found when "Inspecting" the visualization).

When doing this in C#, I run into the problem with the GET request does not allow content-body to be attached, which apparently is common. Any idea on how to get around this, since the query from ElasticSearch has the body in the request?

Am I going about this the wrong way? I just need to return the data from the visualization.

The Elasticsearch APIs that accept a GET with a body will also accept a POST with a body for those languages/frameworks that do not allow sending a GET with a body, which C#/.NET BCL HTTP libraries do not allow.

The Elasticsearch API I'm calling needs a GET with a body in this case. I'm calling a visualization and trying to return the data. That API is rejecting a POST for the same request.

Is it possible to save the Visualization, or perhaps a saved query, and just call that?

That sounds like a Kibana API rather than an Elasticsearch API?

I was eventually able to do the GET with attached body by using curl, and calling the curl as an external process from my c# code. After reading much on the subject, I find that .NET and much of the world do not support a GET with an attached
body, even if the HTTP model supports it.

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