Java equivalent of GET cURL command?

I wasn't (and still not) sure how to do POST to _search.
The following worked for me:

Response response = restClient.performRequest("GET", "index1/type1/_search",Collections.singletonMap("pretty", "true"), entity1);

where entity1 is an HttpEntity which contains the above jsonGet data.
I hope this helps someone in future.

1 Like