# Add headers params to environment

**URL:** <https://community.postman.com/t/add-headers-params-to-environment/6796>\
**Category:** Help Hub\
**Tags:** environments, suggestions, setenvironmentvariab\
**Created:** [July 26, 2019, 2:21pm UTC](https://community.postman.com/t/add-headers-params-to-environment/6796 "2019-07-26T14:21:45Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [July 26, 2019, 7:00pm UTC](https://community.postman.com/t/add-headers-params-to-environment/6796/6 "2019-07-26T19:00:06Z")

</div>

Hey @caudurieau

Is this what you’re trying to do?

> [@Setting headers for entire collection/folder](https://community.postman.com/t/setting-headers-for-entire-collection-folder/708/14):
>
> As of 7.0.9 - You should be able to now do this in your Pre-request Scripts. You can use the following syntax: pm.request.headers.add({key: 'header\_name', value: 'header\_value' }) pm.request.headers.upsert({key: 'header\_name', value: 'header\_value' }) pm.request.headers.remove('header\_name') EDIT: Fork this collection to see how it works directly in Postman: [https://www.postman.com/postman/workspace/postman-answers/collection/9215231-ef055751-7385-45b4-a6f9-91bbd1c47fa5?ctx=documentation](https://www.postman.com/postman/workspace/postman-answers/collection/9215231-ef055751-7385-45b4-a6f9-91bbd1c47fa5?ctx=documentation)

Using the `pm.request.headers.add({key: 'header_name', value: 'header_value' })` function in the `Pre-Request Script` at the Collection or Folder level, you would be able to programmatically set a header in one place that would be applied to multiple requests.

---

_[View the full topic](https://community.postman.com/t/add-headers-params-to-environment/6796)._
