# NEST 7.17 RequestBodyInBytes invalid JSON?

**URL:** <https://discuss.elastic.co/t/nest-7-17-requestbodyinbytes-invalid-json/356181>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [March 26, 2024, 1:16pm UTC](https://discuss.elastic.co/t/nest-7-17-requestbodyinbytes-invalid-json/356181 "2024-03-26T13:16:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomRom27](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@TomRom27](https://discuss.elastic.co/u/TomRom27)\
**Post date:** [March 26, 2024, 1:16pm UTC](https://discuss.elastic.co/t/nest-7-17-requestbodyinbytes-invalid-json/356181/1 "2024-03-26T13:16:37Z")

</div>

Hi,

Recently played a bit with diagnostics of queries sent to ES via NEST and noticed that RequestBodyInBytes (when Utf8 decoded) returns invalid JSON - see attachment: last closing bracket (red) should match 2nd opening bracket in line #1 while now it matches earlier bracket - apparently two closing brackets are missing.

The presented JSON was produced using the below  
Encoding.UTF8.GetString(apiCallDetails.RequestBodyInBytes)  
in OnRequestCompleted handler.

Or I'm doing it wrong?

Cheers,  
Tomek

 ![json](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9b868eac359a6e1ff61a2287069aefc7ac05f9ad.jpeg)

---

<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:** [April 23, 2024, 1:16pm UTC](https://discuss.elastic.co/t/nest-7-17-requestbodyinbytes-invalid-json/356181/2 "2024-04-23T13:16:43Z")

</div>

Closed on April 23, 2024, 1:16pm UTC

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