<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLProtocol/property(forKey:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLProtocol(cm)propertyForKey:inRequest:"
  },
  "title" : "property(forKey:in:)"
}
-->

# property(forKey:in:)

Fetches the property associated with the specified key in the specified request.

```
class func property(forKey key: String, in request: URLRequest) -> Any?
```

## Parameters

`key`

The key of the desired property.

`request`

The request whose properties are to be queried.

## Return Value

The property associated with `key`, or `nil` if no property has been stored for `key`.

## Discussion

Use this method to access protocol-specific information associated with [`URLRequest`](/documentation/Foundation/URLRequest) objects.

---

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)