ObjFW
Instance Methods | List of all members
<OFHTTPClientDelegate> Protocol Reference

A delegate for OFHTTPClient. More...

#import <ObjFW/OFHTTPClient.h>

Inheritance diagram for <OFHTTPClientDelegate>:
<OFObject>

Instance Methods

(void) - client:didCreateSocket:request:
 A callback which is called when an OFHTTPClient creates a socket. More...
 
(void) - client:didReceiveHeaders:statusCode:request:
 A callback which is called when an OFHTTPClient received headers. More...
 
(bool) - client:shouldFollowRedirect:statusCode:request:
 A callback which is called when an OFHTTPClient wants to follow a redirect. More...
 
- Instance Methods inherited from <OFObject>
(Class) - class
 Returns the class of the object. More...
 
(Class) - superclass
 Returns the superclass of the object. 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 const char *) - typeEncodingForSelector:
 Returns the type encoding 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...
 
(bool) - isEqual:
 Checks two objects for equality. More...
 
(uint32_t) - hash
 Calculates a hash for the object. More...
 
(id) - retain
 Increases the retain count. More...
 
(unsigned int) - retainCount
 Returns the retain count. More...
 
(void) - release
 Decreases the retain count. More...
 
(id) - autorelease
 Adds the object to the topmost OFAutoreleasePool of the thread's autorelease pool stack. More...
 
(id) - self
 Returns the receiver. More...
 
(bool) - isProxy
 Returns whether the object is a proxy object. More...
 

Detailed Description

A delegate for OFHTTPClient.

Method Documentation

- (void) client: (OFHTTPClient *)  client
didCreateSocket: (OFTCPSocket *)  socket
request: (OFHTTPRequest *)  request 
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.

Parameters
clientThe OFHTTPClient that created a socket
socketThe socket created by the OFHTTPClient
requestThe request for which the socket was created
- (void) client: (OFHTTPClient *)  client
didReceiveHeaders: (OFDictionary OF_GENERIC(OFString *, OFString *)*)  headers
statusCode: (int)  statusCode
request: (OFHTTPRequest *)  request 
optional

A callback which is called when an OFHTTPClient received headers.

Parameters
clientThe OFHTTPClient which received the headers
headersThe headers received
statusCodeThe status code received
requestThe request for which the headers and status code have been received
- (bool) client: (OFHTTPClient *)  client
shouldFollowRedirect: (OFURL *)  URL
statusCode: (int)  statusCode
request: (OFHTTPRequest *)  request 
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.

Parameters
clientThe OFHTTPClient which wants to follow a redirect
URLThe URL to which it will follow a redirect
statusCodeThe status code for the redirection
requestThe request for which the OFHTTPClient wants to redirect
Returns
A boolean whether the OFHTTPClient should follow the redirect

The documentation for this protocol was generated from the following file: