Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSLog(@"WEB SERVICE CALLED!");
- NSURL *aUrl = [NSURL URLWithString:@"xxx"];
- NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:aUrl
- cachePolicy:NSURLRequestUseProtocolCachePolicy
- timeoutInterval:60.0];
- [request setHTTPMethod:@"POST"];
- NSString *postString = @"grant_type=password&username=xxx&password=xxx";
- [request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];
- NSURLConnection *connection= [[NSURLConnection alloc] initWithRequest:request
- delegate:self];
- if(connection) {
- NSLog(@"Connection Successful");
- } else {
- NSLog(@"Connection could not be made");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement