ZYLURLRequestGenerator.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // ZYLURLRequestGenerator.h
  3. // NetworkLayerBuild
  4. //
  5. // Created by 翟玉磊 on 2017/8/31.
  6. // Copyright © 2017年 翟玉磊. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "ZYLService.h"
  10. #import "ZYLUploadFile.h"
  11. @interface ZYLURLRequestGenerator : NSObject
  12. + (instancetype)sharedInstance;
  13. /**
  14. 发起数据请求
  15. */
  16. - (NSMutableURLRequest *)generateRequestWithUrlPath:(NSString *)urlPath
  17. useHttps:(BOOL)useHttps
  18. method:(NSString *)method
  19. params:(NSDictionary *)params
  20. header:(NSDictionary *)header;
  21. /**
  22. 发起上传请求
  23. */
  24. - (NSMutableURLRequest *)generateUploadRequestWithUrlPath:(NSString *)urlPath
  25. useHttps:(BOOL)useHttps
  26. params:(NSDictionary *)params
  27. contents:(NSArray<ZYLUploadFile *> *)contents
  28. header:(NSDictionary *)header;
  29. /// 获取header
  30. - (NSMutableURLRequest *)setCommonRequestHeaderForRequest:(NSMutableURLRequest *)request;
  31. @end