I am trying to make a simple url call. I cannot convert the bytes into NSString. Following is my code. I get this in my console message; data received from url: †F»∞
-(void)buttonClicked{
NSLog(@"Hello Login clicked..."); NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:@"http://www.apple.com/contact/"]];
[request setHTTPMethod:@"GET"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setTimeoutInterval:60.0];
NSError *error;
NSURLResponse *response;
NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSString *data=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
NSLog(@"data received from url: %s", data);
}