---
title: URLProtocolClient
framework: foundation
role: symbol
role_heading: Protocol
path: foundation/urlprotocolclient
---

# URLProtocolClient

The interface used by URLProtocol subclasses to communicate with the URL Loading System.

## Declaration

```swift
protocol URLProtocolClient : NSObjectProtocol, Sendable
```

## Overview

Overview Don’t implement this protocol in your application. Instead, your URLProtocol subclass calls methods of this protocol on its own client property.

## Topics

### Creating a response

- [urlProtocol(_:didReceive:cacheStoragePolicy:)](foundation/urlprotocolclient/urlprotocol(_:didreceive:cachestoragepolicy:).md)

### Handling redirects

- [urlProtocol(_:wasRedirectedTo:redirectResponse:)](foundation/urlprotocolclient/urlprotocol(_:wasredirectedto:redirectresponse:).md)

### Working with cache data

- [urlProtocol(_:cachedResponseIsValid:)](foundation/urlprotocolclient/urlprotocol(_:cachedresponseisvalid:).md)

### Handling authentication challenges

- [urlProtocol(_:didCancel:)](foundation/urlprotocolclient/urlprotocol(_:didcancel:).md)
- [urlProtocol(_:didReceive:)](foundation/urlprotocolclient/urlprotocol(_:didreceive:).md)

### Indicating loading progress or failure

- [urlProtocol(_:didFailWithError:)](foundation/urlprotocolclient/urlprotocol(_:didfailwitherror:).md)
- [urlProtocol(_:didLoad:)](foundation/urlprotocolclient/urlprotocol(_:didload:).md)
- [urlProtocolDidFinishLoading(_:)](foundation/urlprotocolclient/urlprotocoldidfinishloading(_:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Getting protocol attributes

- [cachedResponse](foundation/urlprotocol/cachedresponse.md)
- [client](foundation/urlprotocol/client.md)
- [request](foundation/urlprotocol/request.md)
- [task](foundation/urlprotocol/task.md)
