Protocol: NSURLProtocolClient
Overview
The NSURLProtocolClient protocol provides the interface used by NSURLProtocol subclasses to communicate with the URL loading system. An application should never have the need to implement this protocol.Sent to indicate to the URL loading system that a cached response is valid. (required)Sent to indicate to the URL loading system that an authentication challenge has been canceled. (required)Sent when the load request fails due to an error. (required)An NSURLProtocol subclass instance, protocol, sends this message to [protocol client] as it loads data. (required)Sent to indicate to the URL loading system that an authentication challenge has been received. (required)Sent to indicate to the URL loading system that the protocol implementation has created a response object for the request. (required)Sent to indicate to the URL loading system that the protocol implementation has been redirected. (required)Sent to indicate to the URL loading system that the protocol implementation has finished loading. (required)
Instance Method Summary (collapse)
-
- URLProtocol:cachedResponseIsValid:
Sent to indicate to the URL loading system that a cached response is valid.
-
- URLProtocol:didCancelAuthenticationChallenge:
Sent to indicate to the URL loading system that an authentication challenge has been canceled.
-
- URLProtocol:didFailWithError:
Sent when the load request fails due to an error.
-
- URLProtocol:didLoadData:
An NSURLProtocol subclass instance, protocol, sends this message to [protocol client] as it loads data.
-
- URLProtocol:didReceiveAuthenticationChallenge:
Sent to indicate to the URL loading system that an authentication challenge has been received.
-
- URLProtocol:didReceiveResponse:cacheStoragePolicy:
Sent to indicate to the URL loading system that the protocol implementation has created a response object for the request.
-
- URLProtocol:wasRedirectedToRequest:redirectResponse:
Sent to indicate to the URL loading system that the protocol implementation has been redirected.
-
- URLProtocolDidFinishLoading:
Sent to indicate to the URL loading system that the protocol implementation has finished loading.
Instance Method Details
- (Object) URLProtocol(protocol, cachedResponseIsValid:cachedResponse)
Sent to indicate to the URL loading system that a cached response is valid. (required)
- (Object) URLProtocol(protocol, didCancelAuthenticationChallenge:challenge)
Sent to indicate to the URL loading system that an authentication challenge has been canceled. (required)
- (Object) URLProtocol(protocol, didFailWithError:error)
Sent when the load request fails due to an error. (required)
- (Object) URLProtocol(protocol, didLoadData:data)
An NSURLProtocol subclass instance, protocol, sends this message to [protocol client] as it loads data. (required)
The data object must contain only new data loaded since the previous invocation of this method.
- (Object) URLProtocol(protocol, didReceiveAuthenticationChallenge:challenge)
Sent to indicate to the URL loading system that an authentication challenge has been received. (required)
The protocol client guarantees that it will answer the request on the same thread that called this method. The client may add a default credential to the challenge it issues to the connection delegate, if protocol did not provide one.
- (Object) URLProtocol(protocol, didReceiveResponse:response, cacheStoragePolicy:policy)
Sent to indicate to the URL loading system that the protocol implementation has created a response object for the request. (required) The implementation should use the provided cache storage policy to determine whether to store the response in a cache.
- (Object) URLProtocol(protocol, wasRedirectedToRequest:request, redirectResponse:redirectResponse)
Sent to indicate to the URL loading system that the protocol implementation has been redirected. (required)
- (Object) URLProtocolDidFinishLoading(protocol)
Sent to indicate to the URL loading system that the protocol implementation has finished loading. (required)