码迷,mamicode.com
首页 > Web开发 > 详细

AFN 请求数据https

时间:2015-09-29 18:27:35      阅读:1484      评论:0      收藏:0      [点我收藏+]

标签:

第一步:

导入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) {

            

        }];

AFN 请求数据https

标签:

原文地址:http://www.cnblogs.com/fengkuangIT/p/4846585.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!