NSError * error = nil; NSHTTPURLResponse * response = nil; [NSURLConnection sendSynchronousRequest:[[NSURLRequest alloc]initWithURL:url] returningResponse:&response error:&error]; if(response.statusCode ==200) { }else { }