# Http\_poller help including headers

**URL:** https://discuss.elastic.co/t/http-poller-help-including-headers/86158
**Category:** Logstash
**Created:** [May 17, 2017, 6:02pm UTC](https://discuss.elastic.co/t/http-poller-help-including-headers/86158 "2017-05-17T18:02:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![FrankC](https://avatars.discourse-cdn.com/v4/letter/f/ed655f/32.png) [@FrankC](https://discuss.elastic.co/u/FrankC)
#### Post date: [May 17, 2017, 6:02pm UTC](https://discuss.elastic.co/t/http-poller-help-including-headers/86158/1 "2017-05-17T18:02:38Z")

</div>

update... I figured out the header issue.

I added a new line to the headers section like this.

```
 headers => {
           Accept => "application/json"
	   "Authorization" => "Bearer <api_token."

}

```

I am using Yahoo's flurry api to get mobile app data.

Per Yahoo: the programatic token should be included in the header as: `Authorization: Bearer <api_token>`

I tested it using ARC rest client and got it to work.

I would like to use logstash's http\_poller and looking for help on how to include that custom header.

This what I have so far for the http\_poller config which makes the connection, but fails b/c its not sending expected header.

```
input {
  http_poller {
    urls => {
       test => {
        # Supports all options supported by ruby's Manticore HTTP client
        method => get
        url => "https://api-metrics.flurry.com/public/v1/data/..."
        headers => {
           Accept => "application/json"
        }
        
      }
    }
    request_timeout => 60
    # Supports "cron", "every", "at" and "in" schedules by rufus scheduler
    # schedule => { cron => "* * * * * UTC"}
    schedule => { every => "1h"}
    # codec => "json"
    # A hash of request metadata info (timing, response headers, etc.) will be sent here
    metadata_target => "http_poller_metadata"
  }
}

 output {
stdout {
 codec => rubydebug
 }
  }

```

Thanks,  
Frank

---

<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 14, 2017, 6:02pm UTC](https://discuss.elastic.co/t/http-poller-help-including-headers/86158/2 "2017-06-14T18:02:41Z")

</div>

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