|
|
|
//
|
|
|
|
// myHttp.h
|
|
|
|
// tianyin
|
|
|
|
//
|
|
|
|
// Created by xTT on 15/6/6.
|
|
|
|
// Copyright (c) 2015年 xTT. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import "AFNetworking.h"
|
|
|
|
#import "NetHeader.h"
|
|
|
|
|
|
|
|
//#import "SVProgressHUD.h"
|
|
|
|
|
|
|
|
#import "myHelper.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define xMyHttp [MyHttp sharedClient]
|
|
|
|
|
|
|
|
|
|
|
|
@interface MyHttp : AFHTTPSessionManager
|
|
|
|
|
|
|
|
@property (nonatomic) BOOL isMust;
|
|
|
|
@property (nonatomic, strong) UIAlertController *noNetAlertView;
|
|
|
|
@property (nonatomic, strong) UIAlertController *errorAlertView;
|
|
|
|
|
|
|
|
+ (instancetype)sharedClient;
|
|
|
|
|
|
|
|
- (NSURLSessionDataTask *)URL:(NSString *)URLString
|
|
|
|
method:(NSString *)method
|
|
|
|
parameters:(id)parameters
|
|
|
|
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
|
|
|
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
|
|
|
|
|
|
|
|
- (NSURLSessionDataTask *)URL:(NSString *)URLString
|
|
|
|
method:(NSString *)method
|
|
|
|
parameters:(id)parameters
|
|
|
|
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
|
|
|
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
|
|
|
showHUD:(BOOL)showHUD;
|
|
|
|
|
|
|
|
- (NSURLSessionDataTask *)URL:(NSString *)URLString
|
|
|
|
method:(NSString *)method
|
|
|
|
parameters:(id)parameters
|
|
|
|
constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> formData))block
|
|
|
|
success:(void (^)(NSURLSessionDataTask * task, id responseObject))success
|
|
|
|
failure:(void (^)(NSURLSessionDataTask * task, NSError * error))failure;
|
|
|
|
|
|
|
|
- (NSURLSessionDataTask *)URL:(NSString *)URLString
|
|
|
|
method:(NSString *)method
|
|
|
|
parameters:(id)parameters
|
|
|
|
constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> formData))block
|
|
|
|
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
|
|
|
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
|
|
|
showHUD:(BOOL)showHUD;
|
|
|
|
|
|
|
|
- (NSURLSessionDataTask *)URL:(NSString *)URLString
|
|
|
|
method:(NSString *)method
|
|
|
|
parameters:(id)parameters
|
|
|
|
constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> formData))block
|
|
|
|
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
|
|
|
|
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
|
|
|
|
showHUD:(BOOL)showHUD
|
|
|
|
showError:(BOOL)showError;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ (NSString *)getURL:(NSString *)URL objArr:(NSArray *)objArr;
|
|
|
|
|
|
|
|
|
|
|
|
- (void)UploadPictureByFileName:(NSString*) fileName
|
|
|
|
Path:(NSData*) path
|
|
|
|
success:(void (^)(id responseObject))success
|
|
|
|
failure:(void (^)(id faiObject))failure;
|
|
|
|
|
|
|
|
|
|
|
|
@end
|