Package apple.foundation.protocol
Interface NSURLProtocolClient
-
public interface NSURLProtocolClient[@protocol] NSURLProtocolClient NSURLProtocolClient provides the interface to the URL loading system that is intended for use by NSURLProtocol implementors.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidURLProtocolCachedResponseIsValid(NSURLProtocol protocol, NSCachedURLResponse cachedResponse)URLProtocol:cachedResponseIsValid: Indicates to an NSURLProtocolClient that the protocol implementation has examined a cached response and has determined that it is valid.voidURLProtocolDidCancelAuthenticationChallenge(NSURLProtocol protocol, NSURLAuthenticationChallenge challenge)URLProtocol:didCancelAuthenticationChallenge: Cancel authentication for the specified requestvoidURLProtocolDidFailWithError(NSURLProtocol protocol, NSError error)URLProtocol:didFailWithError: Indicates to an NSURLProtocolClient that the protocol implementation has failed to load successfully.voidURLProtocolDidFinishLoading(NSURLProtocol protocol)URLProtocolDidFinishLoading: Indicates to an NSURLProtocolClient that the protocol implementation has finished loading successfully.voidURLProtocolDidLoadData(NSURLProtocol protocol, NSData data)URLProtocol:didLoadData: Indicates to an NSURLProtocolClient that the protocol implementation has loaded URL data.voidURLProtocolDidReceiveAuthenticationChallenge(NSURLProtocol protocol, NSURLAuthenticationChallenge challenge)URLProtocol:didReceiveAuthenticationChallenge: Start authentication for the specified request The protocol client guarantees that it will answer the request on the same thread that called this method.voidURLProtocolDidReceiveResponseCacheStoragePolicy(NSURLProtocol protocol, NSURLResponse response, long policy)URLProtocol:didReceiveResponse: Indicates to an NSURLProtocolClient that the protocol implementation has created an NSURLResponse for the current load.voidURLProtocolWasRedirectedToRequestRedirectResponse(NSURLProtocol protocol, NSURLRequest request, NSURLResponse redirectResponse)URLProtocol:wasRedirectedToRequest: Indicates to an NSURLProtocolClient that a redirect has occurred.
-
-
-
Method Detail
-
URLProtocolCachedResponseIsValid
void URLProtocolCachedResponseIsValid(NSURLProtocol protocol, NSCachedURLResponse cachedResponse)
URLProtocol:cachedResponseIsValid: Indicates to an NSURLProtocolClient that the protocol implementation has examined a cached response and has determined that it is valid.- Parameters:
protocol- the NSURLProtocol object sending the message.cachedResponse- the NSCachedURLResponse object that has examined and is valid.
-
URLProtocolDidCancelAuthenticationChallenge
void URLProtocolDidCancelAuthenticationChallenge(NSURLProtocol protocol, NSURLAuthenticationChallenge challenge)
URLProtocol:didCancelAuthenticationChallenge: Cancel authentication for the specified request- Parameters:
protocol- The protocol object cancelling authentication.challenge- The authentication challenge.
-
URLProtocolDidFailWithError
void URLProtocolDidFailWithError(NSURLProtocol protocol, NSError error)
URLProtocol:didFailWithError: Indicates to an NSURLProtocolClient that the protocol implementation has failed to load successfully.- Parameters:
protocol- the NSURLProtocol object sending the message.error- The error that caused the load to fail.
-
URLProtocolDidLoadData
void URLProtocolDidLoadData(NSURLProtocol protocol, NSData data)
URLProtocol:didLoadData: 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.- Parameters:
protocol- the NSURLProtocol object sending the message.data- URL load data being made available.
-
URLProtocolDidReceiveAuthenticationChallenge
void URLProtocolDidReceiveAuthenticationChallenge(NSURLProtocol protocol, NSURLAuthenticationChallenge challenge)
URLProtocol:didReceiveAuthenticationChallenge: 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.- Parameters:
protocol- The protocol object requesting authentication.challenge- The authentication challenge.
-
URLProtocolDidReceiveResponseCacheStoragePolicy
void URLProtocolDidReceiveResponseCacheStoragePolicy(NSURLProtocol protocol, NSURLResponse response, long policy)
URLProtocol:didReceiveResponse: Indicates to an NSURLProtocolClient that the protocol implementation has created an NSURLResponse for the current load.- Parameters:
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.
-
URLProtocolWasRedirectedToRequestRedirectResponse
void URLProtocolWasRedirectedToRequestRedirectResponse(NSURLProtocol protocol, NSURLRequest request, NSURLResponse redirectResponse)
URLProtocol:wasRedirectedToRequest: Indicates to an NSURLProtocolClient that a redirect has occurred.- Parameters:
protocol- the NSURLProtocol object sending the message.request- the NSURLRequest to which the protocol implementation has redirected.
-
URLProtocolDidFinishLoading
void URLProtocolDidFinishLoading(NSURLProtocol protocol)
URLProtocolDidFinishLoading: Indicates to an NSURLProtocolClient that the protocol implementation has finished loading successfully.- Parameters:
protocol- the NSURLProtocol object sending the message.
-
-