1 2 3 4 5 6 7 8 9 10 11 12 13
| -(void)MMhttpService:(NSString *)url parame:(NSDictionary *)parame success:(void (^)(id))success fail:(void (^)(id))failuer{ AFHTTPSessionManager *manage = [AFHTTPSessionManager manager]; manage.requestSerializer.timeoutInterval = 10.0f; [manage POST:url parameters:parame progress:^(NSProgress * _Nonnull uploadProgress) { NSLog(@"这里执行的是progress 代码块"); } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { success(responseObject); } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { failuer(error); }]; }
|