난에 저장되어있는 API를 가지고 : 나는 서버에 내 로그인 암호에 다음 코드 내 통과를 사용하여 액세스하는 경우데이터가 서버에 encrpted 보내기
을 게시물을 통해, 내 데이터는 내 아이폰 애플 리케이션에서 서버/API에 encrpted 무엇입니까?
NSURL *url = [NSURL URLWithString:@"https://my-api-site.com"];
//initialize a request from url
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[url standardizedURL]];
//set http method
[request setHTTPMethod:@"POST"];
//initialize a post data
NSDictionary *postDict = [NSDictionary dictionaryWithObjectsAndKeys:@"username", @"username",
@"password", @"password", nil];
NSError *error=nil;
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:postDict
options:NSJSONWritingPrettyPrinted error:&error];
[request setValue:@"application/x-www-form-urlencoded; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
//set post data of request
[request setHTTPBody:jsonData];
//initialize a connection from request
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
//start the connection
[connection start];
서버로 앱이 암호화 된 데이터를 보내나요?