# How to get auto-generated headers with pm.request.headers?

**URL:** <https://community.postman.com/t/how-to-get-auto-generated-headers-with-pm-request-headers/37900>\
**Category:** Help Hub\
**Tags:** header\
**Created:** [August 5, 2022, 1:51am UTC](https://community.postman.com/t/how-to-get-auto-generated-headers-with-pm-request-headers/37900 "2022-08-05T01:51:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndrWeis](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@AndrWeis](https://community.postman.com/u/AndrWeis)\
**Post date:** [August 5, 2022, 1:51am UTC](https://community.postman.com/t/how-to-get-auto-generated-headers-with-pm-request-headers/37900/1 "2022-08-05T01:51:43Z")

</div>

I have a pre-request script which uses pm.sendRequest to call an endpoint that uses the same auth as the current request. I tried to use pm.request.headers in the script to get the Authorization header so I could add the same header in the pm.sendRequest call, but it doesn’t return the auto-generated headers, only the headers I’ve set manually. Is there any way to access to auto-generated headers in a pre-request script?

I tried

```auto
header: {
    "Authorization": pm.request.headers.get("Authorization"),
    "Content-Type": "application/json"
},

```

---

<div class="post-metadata">

**Author:** ![Veenadevi](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@Veenadevi](https://community.postman.com/u/Veenadevi)\
**Post date:** [October 13, 2022, 4:34am UTC](https://community.postman.com/t/how-to-get-auto-generated-headers-with-pm-request-headers/37900/2 "2022-10-13T04:34:32Z")

</div>

Any solution for this? the same pm.request.headers[“authorization”] working in Test but not in pre-request
