Header[] headers = {new BasicHeader("authorization", "Basic ZWxhc3RpYzplbGFzdGlj")};
RestHighLevelClient client = new RestHighLevelClient(
RestClient.builder(
new HttpHost("ip", 9200, "http")));
String jsonString = "{"analyzer":"my_analyzer","text":"cat on the wall"}";
HttpEntity entity = new NStringEntity(jsonString, ContentType.APPLICATION_JSON);
Response response = client.getLowLevelClient().performRequest("GET", "tweet/_analyze, Collections.emptyMap(), entity);
client.close();
while using this I m getting error "type":"security_exception","reason":"missing authentication token for REST request "