![]() |
API 0.9.5
|
Provides loading of a URL request. More...
#import <CPURLConnection.h>
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: |
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.
connection | the connection that had an error |
error | the 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.
connection | the connection that received a response |
response | the received response |
-(void)connection:(CPURLConnection)connection didReceiveData:(CPString)data; Called when the connection has received data.
connection | the connection that received data |
data | the received data |
-(void)connectionDidFinishLoading:(CPURLConnection)connection; Called when the URL has finished loading.
connection | the 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];
connection | the connection that received the authentication challenge. |
Definition at line 2 of file CPURLConnection.h.
- (void) cancel |
Definition at line 209 of file CPURLConnection.j.
+ (CPURLConnection) connectionWithRequest: | (CPURLRequest) | aRequest | |
delegate: | (id) | aDelegate | |
Definition at line 124 of file CPURLConnection.j.
- (id) delegate |
Definition at line 172 of file CPURLConnection.j.
- (id) initWithRequest: | (CPURLRequest) | aRequest | |
delegate: | (id) | aDelegate | |
Definition at line 164 of file CPURLConnection.j.
- (id) initWithRequest: | (CPURLRequest) | aRequest | |
delegate: | (id) | aDelegate | |
startImmediately: | (BOOL) | shouldStartImmediately | |
Definition at line 136 of file CPURLConnection.j.
- (BOOL) isLocalFileConnection |
Definition at line 223 of file CPURLConnection.j.
+ (CPData) sendSynchronousRequest: | (CPURLRequest) | aRequest | |
returningResponse: | ({CPURLResponse}) | aURLResponse | |
Definition at line 92 of file CPURLConnection.j.
+ (CPData) sendSynchronousRequest: | (CPURLRequest) | aRequest | |
returningResponse: | ({CPURLResponse}) | aURLResponse | |
error: | (id) | anError | |
Definition at line 274 of file CPURLConnection.j.
+ (void) setClassDelegate: | (id) | delegate |
Definition at line 80 of file CPURLConnection.j.
- (void) start |
Definition at line 180 of file CPURLConnection.j.