# How to create request attribute based on JSON request header or response headers?

**URL:** <https://community.dynatrace.com/t/how-to-create-request-attribute-based-on-json-request-header-or-response-headers/33998>\
**Category:** Open Q&A\
**Tags:** request-attributes\
**Created:** [February 3, 2022, 2:16am UTC](https://community.dynatrace.com/t/how-to-create-request-attribute-based-on-json-request-header-or-response-headers/33998 "2022-02-03T02:16:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![theharithsa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theharithsa/32/16236_2.png) [@theharithsa](https://community.dynatrace.com/u/theharithsa)\
**Post date:** [February 3, 2022, 2:16am UTC](https://community.dynatrace.com/t/how-to-create-request-attribute-based-on-json-request-header-or-response-headers/33998/1 "2022-02-03T02:16:25Z")

</div>

We have a customer who wants to get the response size of the request which can be found in the content-length of their JSON header. How can I capture that content length? Will it be good to create a request attribute or is there any other suggestions I can work on? That will help a lot.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [February 5, 2022, 9:43pm UTC](https://community.dynatrace.com/t/how-to-create-request-attribute-based-on-json-request-header-or-response-headers/33998/2 "2022-02-05T21:43:23Z")

</div>

[@theharithsa](https://community.dynatrace.com/user/39872)&nbsp;Content-length is a HTTP response header and it’s possible to capture that with Dynatrace. It’s necessary to set up a request attribute with the desired scope (don’t forget to set it to the integer type).

---

<div class="post-metadata">

**Author:** ![theharithsa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theharithsa/32/16236_2.png) [@theharithsa](https://community.dynatrace.com/u/theharithsa)\
**Post date:** [March 1, 2022, 11:49pm UTC](https://community.dynatrace.com/t/how-to-create-request-attribute-based-on-json-request-header-or-response-headers/33998/3 "2022-03-01T23:49:07Z")

</div>

Thanks Julius,

We have set it up and we got the answer.
