ASIHttpRequest请求HTTPS
2015-11-18 13:54
507 查看
一种方法 ASIHTTPRequest *request = [ASIHTTPRequestrequestWithURL:[NSURLURLWithString:bodyString]]; [request setDelegate:self]; request.timeOutSeconds = 20; [request setRequestMethod:@"POST"]; [request addRequestHeader:@"Content-Type"value:@"application/xml;charset=UTF-8;"]; [request setValidatesSecureCertificate:NO];//请求https的时候,就要设置这个属性 [request startAsynchronous];
二种方法ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:bodyString]];[request setDelegate:self];request.timeOutSeconds = 20; [request setValidatesSecureCertificate:NO];//请求https的时候,就要设置这个属性
[request setRequestMethod:@"POST"];
[request addRequestHeader:@"Content-Type" value:@"application/xml;charset=UTF-8"];
request.defaultResponseEncoding = NSUTF8StringEncoding;
相关文章推荐
- iOS中使用 Reachability 检测网络
- 常见网络通信概念_TCP UDP
- Heritrix3.3.0源码阅读 种子模块(观察者模式实践)
- iOS 网络请求返回错误码汇总
- Tcpdump 和 Wireshark 的结合使用(一)
- HTTP协议详解
- ubuntu网络配置命令
- Android 通过HTTP POST请求互联网数据
- 实现一个简单的http服务器
- AFNetWorking之HTTPS使用
- Android 通过HTTP GET请求互联网数据
- Wireshark和TcpDump抓包分析心得
- https协议
- linux网络连通性 mtr
- 网络基本概念之TCP, UDP, 单播(Unicast), 多播(组播)(Multicast)
- sun.net.www.protocol.http.HttpURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection
- Java中httpClient中的设置超时时间
- Thinkphp .htaccess 与 httpd.ini文件重定向转换问题
- Xcode7发送http请求被拦截的解决方法
- 业界良心机构解密:90后更适合学网络营销的六大理由!