# Using global method and headers for http\_poller multiple urls

**URL:** <https://discuss.elastic.co/t/using-global-method-and-headers-for-http-poller-multiple-urls/370210>\
**Category:** Logstash\
**Created:** [November 8, 2024, 9:58am UTC](https://discuss.elastic.co/t/using-global-method-and-headers-for-http-poller-multiple-urls/370210 "2024-11-08T09:58:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dogee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dogee/32/138890_2.png) [@dogee](https://discuss.elastic.co/u/dogee)\
**Post date:** [November 8, 2024, 9:58am UTC](https://discuss.elastic.co/t/using-global-method-and-headers-for-http-poller-multiple-urls/370210/1 "2024-11-08T09:58:29Z")

</div>

Hello,

Having trouble to use global method GET and headers for multiple urls call.

Copilot told me that it is possible, but it doesn't work in my case.

This is my configuration :

```auto

input {
	http_poller {
		urls => {

			gff => {
                url => "http://bitbucket.serv.cdc.fr/rest/api/latest/projects/GFF/repos/?limit=1000"
            }

            x1 => {
                url => "http://bitbucket.serv.cdc.fr/rest/api/latest/projects/X1/repos/?limit=1000"
            }

		}

		method => "GET"
		
		headers => {
			Accept => "application/json"
			Authorization => "Bearer ${BITBUCKET_TOKEN}"
		}

		schedule => {
			cron => "${BITBUCKET_DEV_REPO_CRON}" 
		}

		codec => "json"
	}
}

```

I get this error :

[ERROR][logstash.inputs.http\_poller] Unknown setting 'method' for http\_poller

---

<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:** [November 8, 2024, 11:40am UTC](https://discuss.elastic.co/t/using-global-method-and-headers-for-http-poller-multiple-urls/370210/2 "2024-11-08T11:40:05Z")

</div>

> [@dogee](#):
>
> [ERROR][logstash.inputs.http\_poller] Unknown setting 'method' for http\_poller

method and headers are per-URL options, so the structure should be

```
http_poller {
	urls => {
		gff => {
            url => "http://bitbucket.serv.cdc.fr/rest/api/latest/projects/GFF/repos/?limit=1000"
			method => "GET"
			headers => {
				Accept => "application/json"
				Authorization => "Bearer ${BITBUCKET_TOKEN}"
			}
        }

```

etc. And yes, that requires repitition of the headers.
