ObjFW
|
A delegate for OFHTTPClient. More...
#import <ObjFW/OFHTTPClient.h>
Instance Methods | |
(void) | - client:didPerformRequest:response:exception: |
A callback which is called when an OFHTTPClient performed a request. More... | |
(void) | - client:didCreateSocket:request: |
A callback which is called when an OFHTTPClient creates a socket. More... | |
(void) | - client:wantsRequestBody:request: |
A callback which is called when an OFHTTPClient wants to send the body for a request. More... | |
(void) | - client:didReceiveHeaders:statusCode:request: |
A callback which is called when an OFHTTPClient received headers. More... | |
(bool) | - client:shouldFollowRedirect:statusCode:request:response: |
A callback which is called when an OFHTTPClient wants to follow a redirect. More... | |
![]() | |
(Class) | - class |
Returns the class of the object. More... | |
(nullable Class) | - superclass |
Returns the superclass of the object. More... | |
(unsigned long) | - hash |
Returns a 32 bit hash for the object. More... | |
(unsigned int) | - retainCount |
Returns the retain count. More... | |
(bool) | - isProxy |
Returns whether the object is a proxy object. More... | |
(bool) | - allowsWeakReference |
Returns whether the object allows weak references. More... | |
(bool) | - isKindOfClass: |
Returns a boolean whether the object of the specified kind. More... | |
(bool) | - isMemberOfClass: |
Returns a boolean whether the object is a member of the specified class. More... | |
(bool) | - respondsToSelector: |
Returns a boolean whether the object responds to the specified selector. More... | |
(bool) | - conformsToProtocol: |
Checks whether the object conforms to the specified protocol. More... | |
(nullable IMP) | - methodForSelector: |
Returns the implementation for the specified selector. More... | |
(nullable id) | - performSelector: |
Performs the specified selector. More... | |
(nullable id) | - performSelector:withObject: |
Performs the specified selector with the specified object. More... | |
(nullable id) | - performSelector:withObject:withObject: |
Performs the specified selector with the specified objects. More... | |
(nullable id) | - performSelector:withObject:withObject:withObject: |
Performs the specified selector with the specified objects. More... | |
(nullable id) | - performSelector:withObject:withObject:withObject:withObject: |
Performs the specified selector with the specified objects. More... | |
(bool) | - isEqual: |
Checks two objects for equality. More... | |
(instancetype) | - retain |
Increases the retain count. More... | |
(void) | - release |
Decreases the retain count. More... | |
(instancetype) | - autorelease |
Adds the object to the topmost autorelease pool of the thread's autorelease pool stack. More... | |
(instancetype) | - self |
Returns the receiver. More... | |
(bool) | - retainWeakReference |
Retain a weak reference to this object. More... | |
A delegate for OFHTTPClient.
|
optional |
A callback which is called when an OFHTTPClient 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.
client | The OFHTTPClient that created a socket |
socket | The socket created by the OFHTTPClient |
request | The request for which the socket was created |
- (void) client: | (OFHTTPClient *) | client | |
didPerformRequest: | (OFHTTPRequest *) | request | |
response: | (nullable OFHTTPResponse *) | response | |
exception: | (nullable id) | exception | |
A callback which is called when an OFHTTPClient performed a request.
client | The OFHTTPClient which performed the request |
request | The request the OFHTTPClient performed |
response | The response to the request performed, or nil on error |
exception | An exception if the request failed, or nil on success |
|
optional |
A callback which is called when an OFHTTPClient received headers.
client | The OFHTTPClient which received the headers |
headers | The headers received |
statusCode | The status code received |
request | The request for which the headers and status code have been received |
|
optional |
A callback which is called when an OFHTTPClient wants to 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 OFHTTPClient 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 OFHTTPClient will follow a redirect. If the maximum number of redirects has been reached already, this callback will not be called.
client | The OFHTTPClient which wants to follow a redirect |
URL | The URL to which it will follow a redirect |
statusCode | The status code for the redirection |
request | The request for which the OFHTTPClient wants to redirect. You are allowed to change the request's headers from this callback and they will be used when following the redirect (e.g. to set the cookies for the new URL), however, keep in mind that this will change the request you originally passed. |
response | The response indicating the redirect |
|
optional |
A callback which is called when an OFHTTPClient wants to send the body for a request.
client | The OFHTTPClient that wants to send the body |
requestBody | A stream into which the body of the request should be written |
request | The request for which the OFHTTPClient wants to send the body |