# Extracting response headers

**URL:** https://community.linx.software/community/t/extracting-response-headers/486
**Category:** How To
**Created:** [December 1, 2020, 2:52pm UTC](https://community.linx.software/community/t/extracting-response-headers/486 "2020-12-01T14:52:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ronan](https://community.linx.software/community/user_avatar/community.linx.software/ronan/32/433_2.png) [@ronan](https://community.linx.software/community/u/ronan)
#### Post date: [December 1, 2020, 2:52pm UTC](https://community.linx.software/community/t/extracting-response-headers/486/1 "2020-12-01T14:52:16Z")

</div>

# Extracting response headers

When making requests using a [CallRESTEndpointFNC](https://linx.software/docs/reference/plugins/rest/content/callrestendpoint) , responses are returned along with the `ResponseHeaders` list in the form of:

```auto
[
   {
      "Name":"string",
      "Value":"string"
   }
]

```

 **Note:**  
  
 The structure of the `Header` list when hosting and receiving requests is different, find out more [here](https://community.linx.software/community/t/resthost-guide-overview/458)

Often, information is returned in these header values for subsequent use, values such as `location` are passed in headers for use in sub-sequent requests involving pagination.

```auto
CallRESTEndpoint: Response Headers:
  Transfer-Encoding = chunked
  Connection = keep-alive
  Access-Control-Allow-Origin = *
  Access-Control-Allow-Methods = GET
  Vary = User-Agent
  CF-Cache-Status = DYNAMIC
  cf-request-id = 06c048ffb00000077a8425d000000001
  Report-To = {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=8xScWvUIuL00gAIkoquwi%2Blpa5f6Up4XZjtkzO3kyGqv54RZC%2FtW7dzUZviJOnKsC6aM4Gq75bKrZieJxI5yUcG2xKwiLNIwZMYta0FY"}],"group":"cf-nel","max_age":604800}
  NEL = {"report_to":"cf-nel","max_age":604800}
  CF-RAY = 5fad777919b9077a-LHR
  Cache-Control = must-revalidate, no-cache
  Date = Tue, 01 Dec 2020 14:23:33 GMT
  Set-Cookie = __cfduid=d770f214e0e521e7d5e82a489e3f68d1b1606832613; expires=Thu, 31-Dec-20 14:23:33 GMT; path=/; domain=.icndb.com; HttpOnly; SameSite=Lax
  Server = cloudflare
  Content-Type = application/json
  Expires = Sat, 26 Jul 1997 05:00:00 GMT
  Content-Length = 167

```

Although you can see the full list of `header` values in the Debug Values panel like below:

 ![image](https://community.linx.software/community/uploads/default/original/1X/e49a4dc178af89be22fbef776dc875cbd5b50395.png)

In order to access `header` items within the list, there are 2 approaches:

1. Use a [ForEachFNC](https://linx.software/docs/reference/plugins/linx/content/foreach) and loop through the `CallRESTEndpoint.ResponseHeaders` list.

2. Use the below expression to extract the needed value

As you can see the second approach is much cleaner, although it requires an understanding of expressions.

 **Sample:**  
  
 Take a look at the below sample Solution to give you a practical demonstration.

> [Solution (.lsoz)](https://community.linx.software/community/uploads/short-url/8B4gjwa1IpkbEafdppIuTdiXAfN.lsoz) (6.2 KB)
