NSURLRequest+QNRequest.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // NSURLRequest+QNRequest.h
  3. // AppTest
  4. //
  5. // Created by yangsen on 2020/4/8.
  6. // Copyright © 2020 com.qiniu. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface NSURLRequest(QNRequest)
  11. /// 是否是七牛请求【内部使用】
  12. /// 作为是否进行请求监听的判断依据 NO,当设置了qn_domain返回YES,反之为NO
  13. @property(nonatomic, assign, readonly)BOOL qn_isQiNiuRequest;
  14. /// 请求id【内部使用】
  15. /// 只有通过设置qn_domain才会有效
  16. @property(nonatomic, strong, nullable, readonly)NSString *qn_identifier;
  17. /// 请求domain【内部使用】
  18. /// 只有通过NSMutableURLRequest设置才会有效
  19. @property(nonatomic, strong, nullable, readonly)NSString *qn_domain;
  20. /// 请求头信息 去除七牛内部标记占位
  21. @property(nonatomic, strong, nullable, readonly)NSDictionary *qn_allHTTPHeaderFields;
  22. + (instancetype)qn_requestWithURL:(NSURL *)url;
  23. /// 获取请求体
  24. - (NSData *)qn_getHttpBody;
  25. - (BOOL)qn_isHttps;
  26. @end
  27. @interface NSMutableURLRequest(QNRequest)
  28. /// 请求domain【内部使用】
  29. @property(nonatomic, strong, nullable)NSString *qn_domain;
  30. @end
  31. NS_ASSUME_NONNULL_END