QNHttpDelegate.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #import <Foundation/Foundation.h>
  2. @class QNResponseInfo;
  3. typedef void (^QNInternalProgressBlock)(long long totalBytesWritten, long long totalBytesExpectedToWrite);
  4. typedef void (^QNCompleteBlock)(QNResponseInfo *info, NSDictionary *resp);
  5. typedef BOOL (^QNCancelBlock)(void);
  6. /**
  7. * Http 客户端接口
  8. */
  9. @protocol QNHttpDelegate <NSObject>
  10. - (void)multipartPost:(NSString *)url
  11. withData:(NSData *)data
  12. withParams:(NSDictionary *)params
  13. withFileName:(NSString *)key
  14. withMimeType:(NSString *)mime
  15. withCompleteBlock:(QNCompleteBlock)completeBlock
  16. withProgressBlock:(QNInternalProgressBlock)progressBlock
  17. withCancelBlock:(QNCancelBlock)cancelBlock
  18. withAccess:(NSString *)access;
  19. - (void)post:(NSString *)url
  20. withData:(NSData *)data
  21. withParams:(NSDictionary *)params
  22. withHeaders:(NSDictionary *)headers
  23. withCompleteBlock:(QNCompleteBlock)completeBlock
  24. withProgressBlock:(QNInternalProgressBlock)progressBlock
  25. withCancelBlock:(QNCancelBlock)cancelBlock
  26. withAccess:(NSString *)access;
  27. @end