를 사용하여 다음과 같은 방법 : 사실 당신이 사이트 있지만, 예를 들어, 사용하여 REST (SOAP) 서비스를 사용 '을 통해'로그인하지
NSString *post = [NSString stringWithFormat:@"Username=%@&Password=%@",@"username",@"password"]; //may be change as per your requirement
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d",[postData length]];
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.yourDoamin.com/test/xyz.aspx"]]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSURLConnection *connection = [[NSURLConnection alloc]initWithRequest:request delegate:self];
if(connection) {
NSLog(@"Connected");
} else {
NSLog(@"Connection Error");
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data
{
// here check response data in your case login password true or false
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
// handle connection error
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
}
JSON. 당신은 REST 스펙을 찾아야 만한다. (존재한다면) 서버 - 클라이언트 통신에 대한 모든 필수 정보를 얻을 수 있어야한다. 일단 그것을 얻으면 POST (NSDictionary의 params) 또는 GET (params가 질의로 이동) 요청을 서버로 보낼 수 있습니다. 희망을 조금 분명히. – Neru