猎豆优选

MtopExtRequestDelegate.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // ApiCallback.h
  3. // mtopext
  4. //
  5. // API请求回调
  6. // Created by sihai on 4/11/14.
  7. // Copyright (c) 2014 Taobao. All rights reserved.
  8. //
  9. #import <Foundation/Foundation.h>
  10. #import <mtopext/Constants.h>
  11. @class MtopExtRequest;
  12. @class MtopExtResponse;
  13. /*!
  14. * 请求开始, 回调block
  15. * @param request
  16. */
  17. typedef void (^MtopExtRequestStarted)(MtopExtRequest* request);
  18. /*!
  19. * 请求失败, 回调block
  20. * @param request
  21. */
  22. typedef void (^MtopExtRequestFailed)(MtopExtResponse* response);
  23. /*!
  24. * 请求成功, 回调block
  25. * @param request
  26. */
  27. typedef void (^MtopExtRequestSucceed)(MtopExtResponse* response);
  28. @protocol MtopExtRequestDelegate<NSObject>
  29. /*!
  30. * 请求开始执行时回调 (开始发送网络请求)
  31. *
  32. */
  33. @optional
  34. -(void) started: (MtopExtRequest*) request;
  35. /*!
  36. * 失败回调, 注意: 我们用的是主线程回调
  37. * @param response response.error 是错误信息
  38. */
  39. -(void) failed: (MtopExtResponse*) response;
  40. /*!
  41. * 成功回调, 注意: 我们用的是主线程回调
  42. * @param response response.error 是错误信息
  43. */
  44. -(void) succeed: (MtopExtResponse*) response;
  45. @end