ASIHttpRequest请求HTTPS
2013-11-08 14:36 甘超波 阅读(5363) 评论(0) 编辑 收藏 举报一种方法
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;
目前我正在专注NLP,请立刻加微信/QQ号 546611623, 免费送你原创《NLP高级执行师》高清视频