24 @
typedef CPURLRequestCachePolicy
44 BOOL _withCredentials;
47 CPTimeInterval _timeoutInterval;
48 CPURLRequestCachePolicy _cachePolicy;
56 + (id)requestWithURL:(
CPURL)aURL
68 + (id)requestWithURL:(
CPURL)anURL cachePolicy:(CPURLRequestCachePolicy)aCachePolicy timeoutInterval:(CPTimeInterval)aTimeoutInterval
89 - (id)initWithURL:(
CPURL)anURL cachePolicy:(CPURLRequestCachePolicy)aCachePolicy timeoutInterval:(CPTimeInterval)aTimeoutInterval
91 if (
self = [
self initWithURL:anURL])
93 _cachePolicy = aCachePolicy;
94 _timeoutInterval = aTimeoutInterval;
108 if (
self = [super
init])
113 _HTTPMethod =
@"GET";
114 _HTTPHeaderFields = @{};
115 _withCredentials = NO;
116 _timeoutInterval = 60.0;
121 switch (_cachePolicy)
157 _URL =
new CFURL(aURL);
166 return [_HTTPHeaderFields objectForKey:aField];
176 [_HTTPHeaderFields setObject:aValue forKey:aField];
191 [request setHTTPBody:[
self HTTPBody]];
248 _HTTPMethod = aValue;
256 return _withCredentials;
262 - (void)setWithCredentials:(BOOL)aValue
264 _withCredentials = aValue;
272 return _HTTPHeaderFields;
280 return _timeoutInterval;
id initWithURL:(CPURL aURL)
CPURLRequestCachePolicy CPURLRequestUseProtocolCachePolicy
CPDictionary allHTTPHeaderFields()
A mutable key-value pair collection.
CPTimeInterval timeoutInterval()
id initWithURL:cachePolicy:timeoutInterval:(CPURL anURL, [cachePolicy] CPURLRequestCachePolicy aCachePolicy, [timeoutInterval] CPTimeInterval aTimeoutInterval)
An immutable string (collection of characters).
CPURLRequestReturnCacheDataElseLoad
CPURLRequestCachePolicy cachePolicy()
void setValue:forHTTPHeaderField:(CPString aValue, [forHTTPHeaderField] CPString aField)
CPURLRequestReturnCacheDataDontLoad
CPDictionary allHTTPHeaderFields()
Contains data obtained during a request made with CPURLConnection.
CPURLRequestReloadIgnoringLocalCacheData