3

I'm converting a bunch of ASI connection requests with the NSURLConnection and NSURLRequest classes from apple.

one of the issues is that the post request has to use https.. but I'm not sure if this is possible with NSURLRequest, this is currently how my code looks.

NSData *postBodyData = [NSData dataWithBytes: [postBodyString UTF8String] length:[postBodyString length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:yourURL]; 
[request setHTTPMethod: @"POST"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
[request setHTTPBody:postBodyData];

My question is, will this work over https, do I have to do anything extra to make sure I am complying with https security standards.. or something else that I'm unaware of. any help would be appreciated

C.Johns
  • 10,185
  • 20
  • 102
  • 156

1 Answers1

5

If the server has an SSL certificate that isn't self-signed, you don't need to anything more than set the url to https. Some other considerations only need to be made if you're doing HTTP authentication.

Alan Zeino
  • 4,406
  • 2
  • 23
  • 30