---
schema_version: "1"
id: 2d789c588efc844d5fe21495590553804fbc6ad35cf8028fe3b44e74f6b52e53
title: getHeaders()
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_System_PageReference_getHeaders.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_PageReference_getHeaders.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 89e8fc474baf801173a7fc4a05f3269a9f526a5746882a95333c93c1a0e33363
description: Returns a map of the request headers, where the key string contains the name of the header, and the value string contains the value of the header.
---
# getHeaders()

Returns a map of the request headers, where the key string contains the name of the header, and the value string contains the value of the header.

## Signature

public Map<String, String\> getHeaders()

## Return Value

Type: [Map](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_map.htm#apex_methods_system_map "Contains methods for the Map collection type.")<[String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type."), [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")\>

## Usage

This map can be modified and remains in scope for the PageReference object. For instance, you could do:

PageReference.getHeaders().put('Date', '9/9/99');

For a description of request headers, see [Request Headers](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_system_pagereference.htm#RequestHeadersSection).