ASIHTTPRequestDelegate.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // ASIHTTPRequestDelegate.h
  3. // Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
  4. //
  5. // Created by Ben Copsey on 13/04/2010.
  6. // Copyright 2010 All-Seeing Interactive. All rights reserved.
  7. //
  8. @class ASIHTTPRequest;
  9. @protocol ASIHTTPRequestDelegate <NSObject>
  10. @optional
  11. // These are the default delegate methods for request status
  12. // You can use different ones by setting didStartSelector / didFinishSelector / didFailSelector
  13. - (void)requestStarted:(ASIHTTPRequest *)request;
  14. - (void)request:(ASIHTTPRequest *)request didReceiveResponseHeaders:(NSDictionary *)responseHeaders;
  15. - (void)request:(ASIHTTPRequest *)request willRedirectToURL:(NSURL *)newURL;
  16. - (void)requestFinished:(ASIHTTPRequest *)request;
  17. - (void)requestFailed:(ASIHTTPRequest *)request;
  18. - (void)requestRedirected:(ASIHTTPRequest *)request;
  19. // When a delegate implements this method, it is expected to process all incoming data itself
  20. // This means that responseData / responseString / downloadDestinationPath etc are ignored
  21. // You can have the request call a different method by setting didReceiveDataSelector
  22. - (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data;
  23. // If a delegate implements one of these, it will be asked to supply credentials when none are available
  24. // The delegate can then either restart the request ([request retryUsingSuppliedCredentials]) once credentials have been set
  25. // or cancel it ([request cancelAuthentication])
  26. - (void)authenticationNeededForRequest:(ASIHTTPRequest *)request;
  27. - (void)proxyAuthenticationNeededForRequest:(ASIHTTPRequest *)request;
  28. @end