httpリクエストを使用して外部サーバーからユーザー名とパスワードを確認するためのログインフォームを作成しようとしましたが、応答が表示されます<>
- (IBAction)getlogin:(UIButton *)sender {
NSString *rawStrusername = [NSString stringWithFormat:@"username=%@",_username.text];
NSString *rawStrpassword = [NSString stringWithFormat:@"password=%@",_password.text];
NSString *post = @"rawStrusername&rawStrpassword";
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
/*
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];*/
NSURL *url = [NSURL URLWithString:@"http://www.othaimmarkets.com/my_services_path/user/login"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
/*[request setValue:postLength forHTTPHeaderField:@"Content-Length"];*/
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSLog(@"responseData: %@", responseData);
}
ヘルプ、提案、例をいただければ幸いです