ASIHTTPRequestでhttpsにアクセスする方法

方法1
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];

方法2

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:bodyString]];
[request setDelegate:self];
request.timeOutSeconds = 20;
[request setValidatesSecureCertificate:NO];
[request setRequestMethod:@"POST"]; [request addRequestHeader:@"Content-Type" value:@"application/xml;charset=UTF-8″]; request.defaultResponseEncoding = NSUTF8StringEncoding;

IOS

Posted by arkgame