# Unable to Parse response body error

**URL:** <https://forum.opensearch.org/t/unable-to-parse-response-body-error/14340>\
**Category:** OpenSearch Client Libraries\
**Tags:** opensearch-java\
**Created:** [May 15, 2023, 3:10pm UTC](https://forum.opensearch.org/t/unable-to-parse-response-body-error/14340 "2023-05-15T15:10:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sriram](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Sriram](https://forum.opensearch.org/u/Sriram)\
**Post date:** [May 15, 2023, 3:10pm UTC](https://forum.opensearch.org/t/unable-to-parse-response-body-error/14340/1 "2023-05-15T15:10:57Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
1.3.9 and 1.3.4

**Describe the issue** :  
We are evaluating migration of Elasticsearch(7.17.0) to Opensearch(1.3.9/1.3.4), high level rest REST client(1.3.9/1.3.4) and 1.0.0 of Opensearch test container.  
While creating index using the high level REST client for the below API call  
curl -X PUT -H “Content-Type: application/json” /index/\_doc/document-id? -d ‘{payload}’  
we get error java.io.IOException: Unable to parse response body for Response{requestLine=PUT /?timeout=1m HTTP/1.1, host=[http://localhost:32802](http://localhost:32802), response=HTTP/1.1 201 Created}  
In the stacktrace we notice that it complains type attribute to be null in DocWriteResponse constructor  
we understand that in Elasticsearch this error occurs when we use REST client of version 7.x to access Server of version 8.x  
However we are unable to figure how to resolve this issue with Opensearch.

**Configuration** :

**Relevant Logs or Screenshots** :

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/359273fad7a57855220f3871233de13d391380c2.png)

---

<div class="post-metadata">

**Author:** ![wbeckler](https://avatars.discourse-cdn.com/v4/letter/w/9d8465/32.png) [@wbeckler](https://forum.opensearch.org/u/wbeckler)\
**Post date:** [May 17, 2023, 8:19am UTC](https://forum.opensearch.org/t/unable-to-parse-response-body-error/14340/2 "2023-05-17T08:19:15Z")

</div>

Have you considered using the opensearch-java client? The HLRC is on track for deprecation in favor of the opensearch-java client.

---

<div class="post-metadata">

**Author:** ![balajee333](https://avatars.discourse-cdn.com/v4/letter/b/f04885/32.png) [@balajee333](https://forum.opensearch.org/u/balajee333)\
**Post date:** [June 15, 2023, 1:42pm UTC](https://forum.opensearch.org/t/unable-to-parse-response-body-error/14340/3 "2023-06-15T13:42:53Z")

</div>

Any solution ? I am also facing the same error

---

<div class="post-metadata">

**Author:** ![wbeckler](https://avatars.discourse-cdn.com/v4/letter/w/9d8465/32.png) [@wbeckler](https://forum.opensearch.org/u/wbeckler)\
**Post date:** [June 16, 2023, 4:30pm UTC](https://forum.opensearch.org/t/unable-to-parse-response-body-error/14340/4 "2023-06-16T16:30:17Z")

</div>

@balajee333 Can you take a look at opensearch-java?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [August 15, 2023, 4:31pm UTC](https://forum.opensearch.org/t/unable-to-parse-response-body-error/14340/5 "2023-08-15T16:31:05Z")

</div>

Closed on August 15, 2023, 4:31pm UTC

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