---
title: "value(forHTTPHeaderField:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/httpurlresponse/value(forhttpheaderfield:)"
---

# value(forHTTPHeaderField:)

Returns the value that corresponds to the given header field.

## Declaration

```swift
func value(forHTTPHeaderField field: String) -> String?
```

## Parameters

- `field`: The name of the header field you want to retrieve. The name is case-insensitive.

## Return Value

Return Value The value associated with the given header field, or nil if no value is associated with the field.

## Discussion

Discussion In keeping with the HTTP RFC, HTTP header field names are case-insensitive.

## See Also

### Getting HTTP response headers

- [allHeaderFields](foundation/httpurlresponse/allheaderfields.md)
