API  0.9.7
 All Classes Files Functions Variables Macros Groups Pages
CPURLConnection Class Reference

Provides loading of a URL request. More...

#import <CPURLConnection.h>

+ Inheritance diagram for CPURLConnection:

Instance Methods

(void) - cancel
 
(id) - delegate
 
(id) - initWithRequest:delegate:
 
(id) - initWithRequest:delegate:startImmediately:
 
(BOOL) - isLocalFileConnection
 
(void) - start
 

Class Methods

(CPURLConnection+ connectionWithRequest:delegate:
 
(CPData+ sendSynchronousRequest:returningResponse:
 
(CPData+ sendSynchronousRequest:returningResponse:error:
 
(void) + setClassDelegate:
 

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.

@delegate -(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
@delegate -(void)connection:(CPURLConnection)connection didReceiveData:(CPString)data;
Called when the connection has received data.
connectionthe connection that received data
datathe received data
@delegate -(void)connectionDidFinishLoading:(CPURLConnection)connection;
Called when the URL has finished loading.
connectionthe connection that finished loading
Class Delegate Method:

@delegate -(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];
Parameters
connectionthe connection that received the authentication challenge.

Definition at line 2 of file CPURLConnection.h.

Method Documentation

- (void) cancel
implementation

Definition at line 212 of file CPURLConnection.j.

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

Definition at line 127 of file CPURLConnection.j.

- (id) delegate
implementation

Definition at line 175 of file CPURLConnection.j.

- (id) initWithRequest: (CPURLRequest aRequest
delegate: (id)  aDelegate 
implementation

Definition at line 167 of file CPURLConnection.j.

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

Definition at line 139 of file CPURLConnection.j.

- (BOOL) isLocalFileConnection
implementation

Definition at line 226 of file CPURLConnection.j.

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

Definition at line 92 of file CPURLConnection.j.

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

Provided by category CPURLConnection(Deprecated).

Definition at line 279 of file CPURLConnection.j.

+ (void) setClassDelegate: (id)  delegate
implementation

Definition at line 80 of file CPURLConnection.j.

- (void) start
implementation

Definition at line 183 of file CPURLConnection.j.


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