A delegate for OFHTTPRequests. More...
#import <OFHTTPRequest.h>
Instance Methods | |
(void) | - request:didCreateSocket: |
A callback which is called when an OFHTTPRequest creates a socket. | |
(void) | - request:didReceiveHeaders:withStatusCode: |
A callback which is called when an OFHTTPRequest received headers. | |
(void) | - request:didReceiveData:withLength: |
A callback which is called when an OFHTTPRequest received data. | |
(BOOL) | - request:willFollowRedirectTo: |
A callback which is called when an OFHTTPRequest will follow a redirect. | |
Instance Methods inherited from <OFObject> | |
(Class) | - class |
Returns the class of the object. | |
(BOOL) | - isKindOfClass: |
Returns a boolean whether the object of the specified kind. | |
(BOOL) | - isMemberOfClass: |
Returns a boolean whether the object is a member of the specified class. | |
(BOOL) | - respondsToSelector: |
Returns a boolean whether the object responds to the specified selector. | |
(BOOL) | - conformsToProtocol: |
Checks whether the object conforms to the specified protocol. | |
(IMP) | - methodForSelector: |
Returns the implementation for the specified selector. | |
(const char *) | - typeEncodingForSelector: |
Returns the type encoding for the specified selector. | |
(id) | - performSelector: |
Performs the specified selector. | |
(id) | - performSelector:withObject: |
Performs the specified selector with the specified object. | |
(id) | - performSelector:withObject:withObject: |
Performs the specified selector with the specified objects. | |
(BOOL) | - isEqual: |
Checks two objects for equality. | |
(uint32_t) | - hash |
Calculates a hash for the object. | |
(id) | - retain |
Increases the retain count. | |
(unsigned int) | - retainCount |
Returns the retain count. | |
(void) | - release |
Decreases the retain count. | |
(id) | - autorelease |
Adds the object to the topmost OFAutoreleasePool of the thread's autorelease pool stack. | |
(id) | - self |
Returns the receiver. | |
(BOOL) | - isProxy |
Returns whether the object is a proxy object. | |
A delegate for OFHTTPRequests.
- (void) request: | (OFHTTPRequest *) | request | |
didCreateSocket: | (OFTCPSocket *) | socket | |
A callback which is called when an OFHTTPRequest creates a socket.
This is useful if the connection is using HTTPS and the server requires a client certificate. This callback can then be used to tell the TLS socket about the certificate. Another use case is to tell the socket about a SOCKS5 proxy it should use for this connection.
request | The OFHTTPRequest that created a socket |
socket | The socket created by the OFHTTPRequest |
- (void) request: | (OFHTTPRequest *) | request | |
didReceiveData: | (const char *) | data | |
withLength: | (size_t) | length | |
A callback which is called when an OFHTTPRequest received data.
This is useful for example if you want to update a status display.
request | The OFHTTPRequest which received data |
data | The data the OFHTTPRequest received |
length | The length of the data received, in bytes |
- (void) request: | (OFHTTPRequest *) | request | |
didReceiveHeaders: | (OFDictionary *) | headers | |
withStatusCode: | (int) | statusCode | |
A callback which is called when an OFHTTPRequest received headers.
request | The OFHTTPRequest which received the headers |
headers | The headers received |
statusCode | The status code received |
- (BOOL) request: | (OFHTTPRequest *) | request | |
willFollowRedirectTo: | (OFURL *) | URL | |
A callback which is called when an OFHTTPRequest will follow a redirect.
If you want to get the headers and data for each redirect, set the number of redirects to 0 and perform a new OFHTTPRequest for each redirect. However, this callback will not be called then and you have to look at the status code to detect a redirect.
This callback will only be called if the OFHTTPRequest will follow a redirect. If the maximum number of redirects has been reached already, this callback will not be called.
request | The OFHTTPRequest which will follow a redirect |
URL | The URL to which it will follow a redirect |