ObjFW
|
A delegate for OFHTTPClient. More...
#include <ObjFW/ObjFW.h>
Instance Methods | |
(void) | - client:didPerformRequest:response:exception: |
A callback which is called when an OFHTTPClient performed a request. | |
(void) | - client:didCreateTCPSocket:request: |
A callback which is called when an OFHTTPClient creates a TCP socket. | |
(void) | - client:didCreateTLSStream:request: |
A callback which is called when an OFHTTPClient creates a TLS stream. | |
(void) | - client:wantsRequestBody:request: |
A callback which is called when an OFHTTPClient wants to send the body for a request. | |
(void) | - client:didReceiveHeaders:statusCode:request: |
A callback which is called when an OFHTTPClient received headers. | |
(bool) | - client:shouldFollowRedirectToIRI:statusCode:request:response: |
A callback which is called when an OFHTTPClient wants to follow a redirect. | |
Instance Methods inherited from <OFObject> | |
(Class) | - class |
Returns the class of the object. | |
(nullable Class) | - superclass |
Returns the superclass of the object. | |
(unsigned long) | - hash |
Returns a hash for the object. | |
(unsigned int) | - retainCount |
Returns the retain count. | |
(bool) | - isProxy |
Returns whether the object is a proxy object. | |
(bool) | - isKindOfClass: |
Returns a boolean whether the object is 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. | |
(nullable IMP) | - methodForSelector: |
Returns the implementation for the specified selector. | |
(nullable id) | - performSelector: |
Performs the specified selector. | |
(nullable id) | - performSelector:withObject: |
Performs the specified selector with the specified object. | |
(nullable id) | - performSelector:withObject:withObject: |
Performs the specified selector with the specified objects. | |
(nullable id) | - performSelector:withObject:withObject:withObject: |
Performs the specified selector with the specified objects. | |
(nullable id) | - performSelector:withObject:withObject:withObject:withObject: |
Performs the specified selector with the specified objects. | |
(bool) | - isEqual: |
Checks two objects for equality. | |
(instancetype) | - retain |
Increases the retain count. | |
(void) | - release |
Decreases the retain count. | |
(instancetype) | - autorelease |
Adds the object to the topmost autorelease pool of the thread's autorelease pool stack. | |
(instancetype) | - self |
Returns the receiver. | |
(bool) | - allowsWeakReference |
Returns whether the object allows a weak reference. | |
(bool) | - retainWeakReference |
Retain a weak reference to this object. | |
A delegate for OFHTTPClient.
|
optional |
A callback which is called when an OFHTTPClient creates a TCP socket.
This can be used to tell the socket about a SOCKS5 proxy it should use for this connection.
client | The OFHTTPClient that created a TCP socket |
TCPSocket | The socket created by the OFHTTPClient |
request | The request for which the TCP socket was created |
|
optionalrequired |
A callback which is called when an OFHTTPClient creates a TLS stream.
This can be used to tell the TLS stream about a client certificate it should use before performing the TLS handshake.
client | The OFHTTPClient that created a TLS stream |
TLSStream | The TLS stream created by the OFHTTPClient |
request | The request for which the TLS stream 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 |
|
optionalrequired |
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 |
|
optionalrequired |
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 |
IRI | The IRI 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 IRI), however, keep in mind that this will change the request you originally passed. |
response | The response indicating the redirect |
|
optionalrequired |
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 |