标签:
第一步:
导入afn库
第二步:
在pch中添加
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#define AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES
第三步:
AFSecurityPolicy *securityPolicy = [AFSecurityPolicy defaultPolicy];
securityPolicy.allowInvalidCertificates = YES;
AFHTTPRequestOperationManager *manger = [AFHTTPRequestOperationManager manager];
manger.securityPolicy = securityPolicy;
[manger POST:urlString parameters:dic success:^(AFHTTPRequestOperation *operation, id responseObject) {
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];
标签:
原文地址:http://www.cnblogs.com/fengkuangIT/p/4846585.html