# Nest CleanupRepositoryAsync return body error

**URL:** <https://discuss.elastic.co/t/nest-cleanuprepositoryasync-return-body-error/288796>\
**Category:** Elasticsearch\
**Tags:** language-clients, snapshot-and-restore\
**Created:** [November 9, 2021, 4:42pm UTC](https://discuss.elastic.co/t/nest-cleanuprepositoryasync-return-body-error/288796 "2021-11-09T16:42:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michel.st-louis](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@michel.st-louis](https://discuss.elastic.co/u/michel.st-louis)\
**Post date:** [November 9, 2021, 4:42pm UTC](https://discuss.elastic.co/t/nest-cleanuprepositoryasync-return-body-error/288796/1 "2021-11-09T16:42:26Z")

</div>

I am using nest with c# and when I use the query:

> Blockquote

var response = await IndexClient.Snapshot.CleanupRepositoryAsync(respositoryName);

> Blockquote

it return ```  
illegal\_argument\_exception Reason: "request [POST /\_snapshot/XXXX/\_cleanup] does not support having a body".  
In the response in debug mode the request seem to have an empty body "# Request:{}". to me this is a bug. is there a way around ?

```auto

```

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [November 16, 2021, 9:08am UTC](https://discuss.elastic.co/t/nest-cleanuprepositoryasync-return-body-error/288796/2 "2021-11-16T09:08:10Z")

</div>

Hi @michel.st-louis,

This is indeed a bug in the client in the client. I've raised [an issue](https://github.com/elastic/elasticsearch-net/issues/6054) to track it and have a fix that will be deployed into the next release.

Steve

---

<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:** [December 14, 2021, 9:09am UTC](https://discuss.elastic.co/t/nest-cleanuprepositoryasync-return-body-error/288796/3 "2021-12-14T09:09:07Z")

</div>

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