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. API-Since: 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidURLProtocolCachedResponseIsValid(@NotNull NSURLProtocol protocol, @NotNull 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(@NotNull NSURLProtocol protocol, @NotNull NSURLAuthenticationChallenge challenge)URLProtocol:didCancelAuthenticationChallenge: Cancel authentication for the specified requestvoidURLProtocolDidFailWithError(@NotNull NSURLProtocol protocol, @NotNull NSError error)URLProtocol:didFailWithError: Indicates to an NSURLProtocolClient that the protocol implementation has failed to load successfully.voidURLProtocolDidFinishLoading(@NotNull NSURLProtocol protocol)URLProtocolDidFinishLoading: Indicates to an NSURLProtocolClient that the protocol implementation has finished loading successfully.voidURLProtocolDidLoadData(@NotNull NSURLProtocol protocol, @NotNull NSData data)URLProtocol:didLoadData: Indicates to an NSURLProtocolClient that the protocol implementation has loaded URL data.voidURLProtocolDidReceiveAuthenticationChallenge(@NotNull NSURLProtocol protocol, @NotNull 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(@NotNull NSURLProtocol protocol, @NotNull NSURLResponse response, long policy)URLProtocol:didReceiveResponse: Indicates to an NSURLProtocolClient that the protocol implementation has created an NSURLResponse for the current load.voidURLProtocolWasRedirectedToRequestRedirectResponse(@NotNull NSURLProtocol protocol, @NotNull NSURLRequest request, @NotNull NSURLResponse redirectResponse)URLProtocol:wasRedirectedToRequest: Indicates to an NSURLProtocolClient that a redirect has occurred.
-
-
-
Method Detail
-
URLProtocolCachedResponseIsValid
void URLProtocolCachedResponseIsValid(@NotNull @NotNull NSURLProtocol protocol, @NotNull @NotNull 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(@NotNull @NotNull NSURLProtocol protocol, @NotNull @NotNull NSURLAuthenticationChallenge challenge)URLProtocol:didCancelAuthenticationChallenge: Cancel authentication for the specified request- Parameters:
protocol- The protocol object cancelling authentication.challenge- The authentication challenge.
-
URLProtocolDidFailWithError
void URLProtocolDidFailWithError(@NotNull @NotNull NSURLProtocol protocol, @NotNull @NotNull 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(@NotNull @NotNull NSURLProtocol protocol, @NotNull @NotNull 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(@NotNull @NotNull NSURLProtocol protocol, @NotNull @NotNull 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(@NotNull @NotNull NSURLProtocol protocol, @NotNull @NotNull 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(@NotNull @NotNull NSURLProtocol protocol, @NotNull @NotNull NSURLRequest request, @NotNull @NotNull 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(@NotNull @NotNull NSURLProtocol protocol)URLProtocolDidFinishLoading: Indicates to an NSURLProtocolClient that the protocol implementation has finished loading successfully.- Parameters:
protocol- the NSURLProtocol object sending the message.
-
-