Conforms to | |
Framework | /System/Library/Frameworks/Foundation.framework |
Availability | Available in Mac OS X v10.2 with Safari 1.0 installed. Available in Mac OS X v10.2.7 and later. |
Companion guide | |
Declared in | NSURLProtocol.h |
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.
– URLProtocol:cachedResponseIsValid:
– URLProtocol:didCancelAuthenticationChallenge:
– URLProtocol:didFailWithError:
– URLProtocol:didLoadData:
– URLProtocol:didReceiveAuthenticationChallenge:
– URLProtocol:didReceiveResponse:cacheStoragePolicy:
– URLProtocol:wasRedirectedToRequest:redirectResponse:
– URLProtocolDidFinishLoading:
Sent to indicate to the URL loading system that a cached response is valid.
- (void)URLProtocol:(NSURLProtocol *)protocol cachedResponseIsValid:(NSCachedURLResponse *)cachedResponse
The URL protocol object sending the message.
The cached response whose validity is being communicated.
NSURLProtocol.h
Sent to indicate to the URL loading system that an authentication challenge has been canceled.
- (void)URLProtocol:(NSURLProtocol *)protocol didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
The URL protocol object sending the message.
The authentication challenge that was canceled.
NSURLProtocol.h
Sent when the load request fails due to an error.
- (void)URLProtocol:(NSURLProtocol *)protocol didFailWithError:(NSError *)error
The URL protocol object sending the message.
The error that caused the failure of the load request.
NSURLProtocol.h
An NSURLProtocol subclass instance, protocol, sends this message to [protocol client]
as it loads data.
- (void)URLProtocol:(NSURLProtocol *)protocol didLoadData:(NSData *)data
The data object must contain only new data loaded since the previous invocation of this method.
NSURLProtocol.h
Sent to indicate to the URL loading system that an authentication challenge has been received.
- (void)URLProtocol:(NSURLProtocol *)protocol didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
The URL protocol object sending the message.
The authentication challenge that has been received.
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.
NSURLProtocol.h
Sent to indicate to the URL loading system that the protocol implementation has created a response object for the request.
- (void)URLProtocol:(NSURLProtocol *)protocol didReceiveResponse:(NSURLResponse *)response cacheStoragePolicy:(NSURLCacheStoragePolicy)policy
The URL protocol object sending the message.
The newly available response object.
The cache storage policy for the response.
The implementation should provide the NSURLCacheStoragePolicy that should be used if the response is to be stored in a cache as the policy value.
NSURLProtocol.h
Sent to indicate to the URL loading system that the protocol implementation has been redirected.
- (void)URLProtocol:(NSURLProtocol *)protocol wasRedirectedToRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
The URL protocol object sending the message.
The new request that the original request was redirected to.
The response from the original request that caused the redirect.
NSURLProtocol.h
Sent to indicate to the URL loading system that the protocol implementation has finished loading.
- (void)URLProtocolDidFinishLoading:(NSURLProtocol *)protocol
The URL protocol object sending the message.
NSURLProtocol.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)