You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.9 KiB
79 lines
2.9 KiB
1 year ago
|
//
|
||
|
// 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
|