# Pass Requset Body to Http\_Poller

**URL:** https://discuss.elastic.co/t/pass-requset-body-to-http-poller/46180
**Category:** Logstash
**Created:** [April 3, 2016, 7:00pm UTC](https://discuss.elastic.co/t/pass-requset-body-to-http-poller/46180 "2016-04-03T19:00:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Sameer\_Panicker](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Sameer\_Panicker](https://discuss.elastic.co/u/Sameer_Panicker)
#### Post date: [April 3, 2016, 7:00pm UTC](https://discuss.elastic.co/t/pass-requset-body-to-http-poller/46180/1 "2016-04-03T19:00:56Z")

</div>

I am able to connect to my services using http\_poller for all the GET services.

I have some POST service to monitor which accepts a json body

Input -  
{  
"AreaCode": "111",  
"CountryCode" : "01",  
"Number": "1231231"  
}

How can I pass this request ?

---

<div class="post-metadata">

### Author: ![Sameer\_Panicker](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Sameer\_Panicker](https://discuss.elastic.co/u/Sameer_Panicker)
#### Post date: [April 3, 2016, 8:00pm UTC](https://discuss.elastic.co/t/pass-requset-body-to-http-poller/46180/2 "2016-04-03T20:00:39Z")

</div>

I tried this but got 400 - Bad Request. Saw my appln. logs, the input request was null.

mapping =\>  
{  
"body" =\>  
{  
AreaCode =\> "111",  
CountryCode =\> "01",  
Number =\> "1231231"  
}  
}

The format is wrong. Couldnt get the precise one. Please help.

---

<div class="post-metadata">

### Author: ![Sameer\_Panicker](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Sameer\_Panicker](https://discuss.elastic.co/u/Sameer_Panicker)
#### Post date: [April 4, 2016, 4:05pm UTC](https://discuss.elastic.co/t/pass-requset-body-to-http-poller/46180/3 "2016-04-04T16:05:41Z")

</div>

Can anyone please provide an update on this ?

---

<div class="post-metadata">

### Author: ![Sameer\_Panicker](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Sameer\_Panicker](https://discuss.elastic.co/u/Sameer_Panicker)
#### Post date: [April 4, 2016, 4:36pm UTC](https://discuss.elastic.co/t/pass-requset-body-to-http-poller/46180/4 "2016-04-04T16:36:51Z")

</div>

Got one step ahead. Corrected the request body -

body =\> '{ "AreaCode": "123","CountryCode": "01","Number": "1231231" }'

But now I am getting "response\_message" =\> "Unsupported Media Type".

I have already specified it in the header -

headers =\> { Accept =\> "application/json" }

What am I missing here ?

---

<div class="post-metadata">

### Author: ![Sameer\_Panicker](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Sameer\_Panicker](https://discuss.elastic.co/u/Sameer_Panicker)
#### Post date: [April 4, 2016, 5:32pm UTC](https://discuss.elastic.co/t/pass-requset-body-to-http-poller/46180/5 "2016-04-04T17:32:43Z")

</div>

Got the fix.

Replaced in the header section -

"Content-Type" =\> "application/json"

---

<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 6, 2017, 5:04am UTC](https://discuss.elastic.co/t/pass-requset-body-to-http-poller/46180/6 "2017-07-06T05:04:01Z")

</div>


