API  0.9.10
CPURLConnection Class Reference

Provides loading of a URL request. More...

#import <CPURLConnection.h>

+ Inheritance diagram for CPURLConnection:

Instance Methods

(void) - cancel
 
(CPURLRequest- currentRequest
 
(id) - delegate
 
(id) - initWithRequest:delegate:
 
(id) - initWithRequest:delegate:startImmediately:
 
(BOOL) - isLocalFileConnection
 
(CPOperation- operation
 
(CPURLRequest- originalRequest
 
(void) - start
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(id) - init
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(CPURLConnection+ connectionWithRequest:delegate:
 
(CPURLConnection+ sendAsynchronousRequest:queue:completionHandler:
 
(CPData+ sendSynchronousRequest:returningResponse:
 
(CPData+ sendSynchronousRequest:returningResponse:error:
 
(void) + setClassDelegate:
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Detailed Description

Provides loading of a URL request.

An interface to downloading content at a specified URL. Using one of the class methods, you can obtain the data.

-(void)connection:(CPURLConnection)connection didFailWithError:(id)error; Called when the connection encounters an error.

Parameters
connectionthe connection that had an error
errorthe error, which is either a javascript DOMException or an http status code (javascript number/CPNumber)

-(void)connection:(CPURLConnection)connection didReceiveResponse:(CPHTTPURLResponse)response; Called when the connection receives a response.

Parameters
connectionthe connection that received a response
responsethe received response

-(void)connection:(CPURLConnection)connection didReceiveData:(CPString)data; Called when the connection has received data.

Parameters
connectionthe connection that received data
datathe received data

-(void)connectionDidFinishLoading:(CPURLConnection)connection; Called when the URL has finished loading.

Parameters
connectionthe connection that finished loading

Class Delegate Method:

-(void)connectionDidReceiveAuthenticationChallenge:(id)connection The class delegate allows you to set global behavior for when authentication challenges (401 status codes) are returned.

The recommended way to handle this method is to store a reference to the connection, and then use whatever method you have to authenticate yourself. Once you've authenticated yourself, you should cancel and then start the connection:

[connection cancel];
[connection start];
@param connection the connection that received the authentication challenge.

Definition at line 2 of file CPURLConnection.h.

Method Documentation

◆ cancel()

- (void) cancel
implementation

Definition at line 276 of file CPURLConnection.j.

◆ connectionWithRequest:delegate:()

+ (CPURLConnection) connectionWithRequest: (CPURLRequest aRequest
delegate: (id)  aDelegate 
implementation

Definition at line 155 of file CPURLConnection.j.

◆ currentRequest()

- (CPURLRequest) currentRequest
implementation

Synthesized accessor method.

Provided by category CPURLConnection(CPSynthesizedAccessors).

Definition at line 453 of file CPURLConnection.j.

◆ delegate()

- (id) delegate
implementation

Definition at line 231 of file CPURLConnection.j.

◆ initWithRequest:delegate:()

- (id) initWithRequest: (CPURLRequest aRequest
delegate: (id <CPURLConnectionDelegate>)  aDelegate 
implementation

Definition at line 223 of file CPURLConnection.j.

◆ initWithRequest:delegate:startImmediately:()

- (id) initWithRequest: (CPURLRequest aRequest
delegate: (id <CPURLConnectionDelegate>)  aDelegate
startImmediately: (BOOL)  shouldStartImmediately 
implementation

Definition at line 167 of file CPURLConnection.j.

◆ isLocalFileConnection()

- (BOOL) isLocalFileConnection
implementation

Definition at line 293 of file CPURLConnection.j.

◆ operation()

- (CPOperation) operation
implementation

Synthesized accessor method.

Provided by category CPURLConnection(CPSynthesizedAccessors).

Definition at line 461 of file CPURLConnection.j.

◆ originalRequest()

- (CPURLRequest) originalRequest
implementation

Synthesized accessor method.

Provided by category CPURLConnection(CPSynthesizedAccessors).

Definition at line 445 of file CPURLConnection.j.

◆ sendAsynchronousRequest:queue:completionHandler:()

+ (CPURLConnection) sendAsynchronousRequest: (CPURLRequest aRequest
queue: (CPOperationQueue aQueue
completionHandler: (Function)  aHandler 
implementation

Definition at line 144 of file CPURLConnection.j.

◆ sendSynchronousRequest:returningResponse:()

+ (CPData) sendSynchronousRequest: (CPURLRequest aRequest
returningResponse: (/*{*/CPURLResponse/*}*/)  aURLResponse 
implementation

Definition at line 107 of file CPURLConnection.j.

◆ sendSynchronousRequest:returningResponse:error:()

+ (CPData) sendSynchronousRequest: (CPURLRequest aRequest
returningResponse: (/*{*/CPURLResponse/*}*/)  aURLResponse
error: (id)  anError 
implementation

Provided by category CPURLConnection(Deprecated).

Definition at line 424 of file CPURLConnection.j.

◆ setClassDelegate:()

+ (void) setClassDelegate: (id <CPURLConnectionDelegate>)  delegate
implementation

Definition at line 95 of file CPURLConnection.j.

◆ start()

- (void) start
implementation

Definition at line 239 of file CPURLConnection.j.


The documentation for this class was generated from the following files: