# Analyze method error

**URL:** https://discuss.elastic.co/t/analyze-method-error/132121
**Category:** Elasticsearch
**Created:** [May 16, 2018, 12:27pm UTC](https://discuss.elastic.co/t/analyze-method-error/132121 "2018-05-16T12:27:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aarthinim](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@aarthinim](https://discuss.elastic.co/u/aarthinim)
#### Post date: [May 16, 2018, 12:27pm UTC](https://discuss.elastic.co/t/analyze-method-error/132121/1 "2018-05-16T12:27:35Z")

</div>

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 "

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 16, 2018, 1:00pm UTC](https://discuss.elastic.co/t/analyze-method-error/132121/2 "2018-05-16T13:00:08Z")

</div>

Did you read [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/\_basic\_authentication.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/_basic_authentication.html)

?

---

<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: [June 13, 2018, 1:00pm UTC](https://discuss.elastic.co/t/analyze-method-error/132121/3 "2018-06-13T13:00:13Z")

</div>

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