QNCFHttpClientInner.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // QNHttpClient.h
  3. // AppTest
  4. //
  5. // Created by yangsen on 2020/4/7.
  6. // Copyright © 2020 com.qiniu. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @protocol QNCFHttpClientInnerDelegate <NSObject>
  11. - (void)redirectedToRequest:(NSURLRequest *)request
  12. redirectResponse:(NSURLResponse *)redirectResponse;
  13. - (void)onError:(NSError *)error;
  14. - (void)didSendBodyData:(int64_t)bytesSent
  15. totalBytesSent:(int64_t)totalBytesSent
  16. totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend;
  17. - (void)onReceiveResponse:(NSURLResponse *)response httpVersion:(NSString *)httpVersion;
  18. - (void)didLoadData:(NSData *)data;
  19. - (void)didFinish;
  20. @end
  21. @interface QNCFHttpClientInner : NSOperation
  22. @property(nonatomic, strong, readonly)NSMutableURLRequest *request;
  23. @property(nonatomic, strong, readonly)NSDictionary *connectionProxy;
  24. @property(nonatomic, weak)id <QNCFHttpClientInnerDelegate> delegate;
  25. + (instancetype)client:(NSURLRequest *)request connectionProxy:(NSDictionary *)connectionProxy;
  26. @end
  27. NS_ASSUME_NONNULL_END