AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
AFSecurityPolicy *securityPolicy = [AFSecurityPolicy defaultPolicy];
securityPolicy.validatesDomainName = NO;
securityPolicy.allowInvalidCertificates = YES;
manager.securityPolicy = securityPolicy;
NSDictionary *params = (NSDictionary *)data;
[manager POST:[NSString stringWithFormat:@"%@%@",APP_SERVER_ADDRESS,path] parameters:params constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) {
NSLog(@"formData === %@",formData);
} progress:^(NSProgress * _Nonnull uploadProgress) {
NSLog(@"uploadProgress === %@",uploadProgress);
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"reposbObject === %@",responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"error === %@",error);
}];
网友评论