12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // ZYLNetworkClient.h
- // NetworkLayerBuild
- //
- // Created by 翟玉磊 on 2017/8/31.
- // Copyright © 2017年 翟玉磊. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import "ZYLUploadFile.h"
- #import "ZYLNetworkConfig.h"
- @interface ZYLNetworkClient : NSObject
- + (instancetype)sharedInstance;
- - (NSURLSessionDataTask *)dataTaskWithUrlPath:(NSString *)urlPath
- useHttps:(BOOL)useHttps
- requestType:(ZYLNetworkRequestType)requestType
- params:(NSDictionary *)params
- header:(NSDictionary *)header
- completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
- - (NSNumber *)dispatchTaskWithUrlPath:(NSString *)urlPath
- useHttps:(BOOL)useHttps
- requestType:(ZYLNetworkRequestType)requestType
- params:(NSDictionary *)params
- header:(NSDictionary *)header
- completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
- - (NSNumber *)dispathTask:(NSURLSessionTask *)task;
- - (NSNumber *)uploadDataWithUrlPath:(NSString *)urlPath
- useHttps:(BOOL)useHttps
- contents:(NSArray<ZYLUploadFile *> *)contents
- params:(NSDictionary *)params
- header:(NSDictionary *)header
- progressHandler:(void (^)(NSProgress *))progressHandler
- completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))comletionHandler;
- - (void)cancelAllTask;
- - (void)cancelTaskWithTaskIdentifier:(NSNumber *)taskIdentifier;
- ///获取请求中的task任务(请求完成后自动移除task任务)
- - (NSURLSessionDataTask *)getTask:(NSNumber *)taskIdentifier;
- @end
|