# How to post the http request with Authorization header , header content type and Body using logstash HTTP poller input plugin?

**URL:** https://discuss.elastic.co/t/how-to-post-the-http-request-with-authorization-header-header-content-type-and-body-using-logstash-http-poller-input-plugin/180544
**Category:** Logstash
**Created:** [May 10, 2019, 11:15am UTC](https://discuss.elastic.co/t/how-to-post-the-http-request-with-authorization-header-header-content-type-and-body-using-logstash-http-poller-input-plugin/180544 "2019-05-10T11:15:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![saroja](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@saroja](https://discuss.elastic.co/u/saroja)
#### Post date: [May 10, 2019, 11:15am UTC](https://discuss.elastic.co/t/how-to-post-the-http-request-with-authorization-header-header-content-type-and-body-using-logstash-http-poller-input-plugin/180544/1 "2019-05-10T11:15:16Z")

</div>

Hi,  
I have to post a request with different attributes of Authorization header , header content type and Body part . can anybody try to help out this.

input {

http\_poller {  
urls =\> {  
request1 =\> {  
method =\> "post"  
headers =\> {"Content-Type" =\> "application/json"}  
url =\> "[http://localhost/v3/token](http://localhost/v3/token)"

```
	 body => '{ 
			       "grant_type" : "password",
				   "username" :"UN1",
				   "password" : "mypass",
				   "scope" :"<scope value>"
			    }'
			  auth => {
                    apikey=> "9xx123456"
                    passwordkey => "paskey"	
               }

            }
			
        }
	}
}

```

Kindly assist , if you are facing same issue.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 10, 2019, 3:10pm UTC](https://discuss.elastic.co/t/how-to-post-the-http-request-with-authorization-header-header-content-type-and-body-using-logstash-http-poller-input-plugin/180544/2 "2019-05-10T15:10:29Z")

</div>

The configuration of an input is fixed at startup. If you want to make different http requests at different times perhaps you could use an http filter instead of an input.

---

<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: [June 7, 2019, 3:10pm UTC](https://discuss.elastic.co/t/how-to-post-the-http-request-with-authorization-header-header-content-type-and-body-using-logstash-http-poller-input-plugin/180544/3 "2019-06-07T15:10:42Z")

</div>

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