---
title: getResponseHeader
framework: tvmljs
role: symbol
role_heading: Instance Method
path: tvmljs/xmlhttprequest/1627438-getresponseheader
---

# getResponseHeader

Retrieves the field value from the response that is contained in the specified header.

## Declaration

```data
String getResponseHeader(
    in String header
);
```

```data
DOMString? getResponseHeader(
    DOMString header
);
```

## Parameters

- `header`: The header field name. An exception is raised if this value is not null or String.

## Return Value

Return Value The header field value.

## Discussion

Discussion If the header value is Set-Cookie or Set-Cookie2, the value inside the header will not be returned. This method returns null if no response has been received or if the specified header doesn’t exist.

## See Also

### Manipulating the Header List

- [getAllResponseHeaders](tvmljs/xmlhttprequest/1627343-getallresponseheaders.md)
- [setRequestHeader](tvmljs/xmlhttprequest/1627317-setrequestheader.md)
