public interface NSURLProtocolClient
NSURLProtocolClient provides the interface to the URL loading system that is intended for use by NSURLProtocol implementors.
| Modifier and Type | Method and Description |
|---|---|
void |
URLProtocolCachedResponseIsValid(NSURLProtocol protocol,
NSCachedURLResponse cachedResponse)
URLProtocol:cachedResponseIsValid:
|
void |
URLProtocolDidCancelAuthenticationChallenge(NSURLProtocol protocol,
NSURLAuthenticationChallenge challenge)
URLProtocol:didCancelAuthenticationChallenge:
|
void |
URLProtocolDidFailWithError(NSURLProtocol protocol,
NSError error)
URLProtocol:didFailWithError:
|
void |
URLProtocolDidFinishLoading(NSURLProtocol protocol)
URLProtocolDidFinishLoading:
|
void |
URLProtocolDidLoadData(NSURLProtocol protocol,
NSData data)
URLProtocol:didLoadData:
|
void |
URLProtocolDidReceiveAuthenticationChallenge(NSURLProtocol protocol,
NSURLAuthenticationChallenge challenge)
URLProtocol:didReceiveAuthenticationChallenge:
|
void |
URLProtocolDidReceiveResponseCacheStoragePolicy(NSURLProtocol protocol,
NSURLResponse response,
long policy)
URLProtocol:didReceiveResponse:
|
void |
URLProtocolWasRedirectedToRequestRedirectResponse(NSURLProtocol protocol,
NSURLRequest request,
NSURLResponse redirectResponse)
URLProtocol:wasRedirectedToRequest:
|
void URLProtocolCachedResponseIsValid(NSURLProtocol protocol, NSCachedURLResponse cachedResponse)
Indicates to an NSURLProtocolClient that the protocol implementation has examined a cached response and has determined that it is valid.
protocol - the NSURLProtocol object sending the message.cachedResponse - the NSCachedURLResponse object that has
examined and is valid.void URLProtocolDidCancelAuthenticationChallenge(NSURLProtocol protocol, NSURLAuthenticationChallenge challenge)
Cancel authentication for the specified request
protocol - The protocol object cancelling authentication.challenge - The authentication challenge.void URLProtocolDidFailWithError(NSURLProtocol protocol, NSError error)
Indicates to an NSURLProtocolClient that the protocol implementation has failed to load successfully.
protocol - the NSURLProtocol object sending the message.error - The error that caused the load to fail.void URLProtocolDidLoadData(NSURLProtocol protocol, NSData data)
Indicates to an NSURLProtocolClient that the protocol implementation has loaded URL data.
The data object must contain only new data loaded since the previous call to this method (if any), not cumulative data for the entire load.
protocol - the NSURLProtocol object sending the message.data - URL load data being made available.void URLProtocolDidReceiveAuthenticationChallenge(NSURLProtocol protocol, NSURLAuthenticationChallenge challenge)
Start authentication for the specified request
The protocol client guarantees that it will answer the request on the same thread that called this method. It may add a default credential to the challenge it issues to the connection delegate, if the protocol did not provide one.
protocol - The protocol object requesting authentication.challenge - The authentication challenge.void URLProtocolDidReceiveResponseCacheStoragePolicy(NSURLProtocol protocol, NSURLResponse response, long policy)
Indicates to an NSURLProtocolClient that the protocol implementation has created an NSURLResponse for the current load.
protocol - the NSURLProtocol object sending the message.response - the NSURLResponse object the protocol implementation
has created.policy - The NSURLCacheStoragePolicy the protocol
has determined should be used for the given response if the
response is to be stored in a cache.void URLProtocolWasRedirectedToRequestRedirectResponse(NSURLProtocol protocol, NSURLRequest request, NSURLResponse redirectResponse)
Indicates to an NSURLProtocolClient that a redirect has occurred.
protocol - the NSURLProtocol object sending the message.request - the NSURLRequest to which the protocol implementation
has redirected.void URLProtocolDidFinishLoading(NSURLProtocol protocol)
Indicates to an NSURLProtocolClient that the protocol implementation has finished loading successfully.
protocol - the NSURLProtocol object sending the message.