Index: src/OFHTTPClient.h ================================================================== --- src/OFHTTPClient.h +++ src/OFHTTPClient.h @@ -93,10 +93,21 @@ - (bool)client: (OFHTTPClient *)client shouldFollowRedirect: (OFURL *)URL statusCode: (int)statusCode request: (OFHTTPRequest *)request response: (OFHTTPResponse *)response; + +/*! + * @brief A callback which is called when an OFHTTPClient performed a request. + * + * @param client The OFHTTPClient which performed the request + * @param request The request the OFHTTPClient performed + * @param response The response to the request performed + */ +- (void)client: (OFHTTPClient *)client + didPerformRequest: (OFHTTPRequest *)request + response: (OFHTTPResponse *)response; @end /*! * @class OFHTTPClient OFHTTPClient.h ObjFW/OFHTTPClient.h * Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -731,10 +731,16 @@ if (status / 100 != 2) @throw [OFHTTPRequestFailedException exceptionWithRequest: request response: response]; + + if ([_delegate respondsToSelector: @selector(client:didPerformRequest: + response:)]) + [_delegate client: self + didPerformRequest: request + response: response]; return response; } - (void)close