<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSessionConfiguration/httpAdditionalHeaders",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLSessionConfiguration(py)HTTPAdditionalHeaders"
  },
  "title" : "httpAdditionalHeaders"
}
-->

# httpAdditionalHeaders

A dictionary of additional headers to send with requests.

```
var httpAdditionalHeaders: [AnyHashable : Any]? { get set }
```

## Discussion

This property specifies additional headers that are added to all tasks within sessions based on this configuration. For example, you might set the `User-Agent` header so that it is automatically included in every request your app makes through sessions based on this configuration.

An [`URLSession`](/documentation/Foundation/URLSession) object is designed to handle various aspects of the HTTP protocol for you. As a result, you should not modify the following headers:

- `Authorization`
- `Connection`
- `Host`
- `Proxy-Authenticate`
- `Proxy-Authorization`
- `WWW-Authenticate`

Additionally, if the length of your upload body data can be determined automatically—for example, if you provide the body content with an [NSData](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html#//apple_ref/doc/uid/20001012-47169) object—the value of `Content-Length` is set for you.

If the same header appears in both this array and the request object (where applicable), the request object’s value takes precedence.

The default value is an empty array.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)