# Request Body is Required

**URL:** <https://discuss.elastic.co/t/request-body-is-required/275691>\
**Category:** Kibana\
**Created:** [June 11, 2021, 2:09pm UTC](https://discuss.elastic.co/t/request-body-is-required/275691 "2021-06-11T14:09:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Mobley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tim_mobley/32/94741_2.png) [@Tim\_Mobley](https://discuss.elastic.co/u/Tim_Mobley)\
**Post date:** [June 11, 2021, 2:09pm UTC](https://discuss.elastic.co/t/request-body-is-required/275691/1 "2021-06-11T14:09:49Z")

</div>

I am attempting to use the **reindex** API to combine indices for the month into one single index:

```auto
POST _reindex?pretty
{
  "conflicts": "proceed",
  "source": {
    "index": "my-index-2021.04.*"
  },
  "dest": {
    "index": "my-index-2021.04",
    "op_type": "create"
  }
}

```

...however, I am running into the following error in Dev Tools:

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "parse_exception",
        "reason" : "request body is required"
      }
    ],
    "type" : "parse_exception",
    "reason" : "request body is required"
  },
  "status" : 400
}

```

I did see an [almost identical post](https://discuss.elastic.co/t/reindex-fails-in-kibana-devtools-console-but-succeeds-on-command-line-using-curl/237266) about this, but no solution was provided.

Thank you!  
Tim

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [June 14, 2021, 2:44pm UTC](https://discuss.elastic.co/t/request-body-is-required/275691/2 "2021-06-14T14:44:14Z")

</div>

That looks like a correct request to me. Can you check for any errant spaces or tabs in your request? I assume you're using Dev Tools.

---

<div class="post-metadata">

**Author:** ![Tim\_Mobley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tim_mobley/32/94741_2.png) [@Tim\_Mobley](https://discuss.elastic.co/u/Tim_Mobley)\
**Post date:** [June 15, 2021, 11:13am UTC](https://discuss.elastic.co/t/request-body-is-required/275691/3 "2021-06-15T11:13:34Z")

</div>

Yes, I'm using Dev Tools. I did see in that other post that the user having my problem was able to perform this using curl, but in my case that fails as well. Here is my curl command:

```auto
curl -XPOST "http://hot-data-node:9200/_reindex" -H 'Content-Type: application/json' -d'{ "source": { "index": "my-index-2021.04.*" }, "dest": { "index": "my-index-2021.04" }}'

```

But get the following output:

```auto
{"error": "Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}curl: (6) Could not resolve host: application'
curl: (6) Could not resolve host: source
curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: index
curl: (6) Could not resolve host: my-index-2021.04.*
curl: (3) [globbing] unmatched close brace/bracket in column 1
curl: (6) Could not resolve host: dest
curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: index
curl: (6) Could not resolve host: my-index-2021.04
curl: (3) [globbing] unmatched close brace/bracket in column 1

```

---

<div class="post-metadata">

**Author:** ![Tim\_Mobley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tim_mobley/32/94741_2.png) [@Tim\_Mobley](https://discuss.elastic.co/u/Tim_Mobley)\
**Post date:** [June 15, 2021, 2:41pm UTC](https://discuss.elastic.co/t/request-body-is-required/275691/4 "2021-06-15T14:41:50Z")

</div>

I also tried it in PowerShell using the following command (unsuccessfully):

```auto
Invoke-RestMethod -Method POST "http://hot-data-node:9200/_reindex" -Headers 'Content-Type: application' -Body 'Content-Type: application/json' -d'{ "source": { "index": "my-index-2021.04.*" }, "dest": { "index": "my-index-2021.04" }}'

```

---

<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:** [July 13, 2021, 2:42pm UTC](https://discuss.elastic.co/t/request-body-is-required/275691/5 "2021-07-13T14:42:28Z")

</div>

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