1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
NSHTTPURLResponse * response ;
NSError * error ;
NSMutableURLRequest * request ;
request = [[[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://www.secure.banquepopulaire.fr/amserver/UI/Login?goto=https%3A%2F%2Fwww.ibps.occitane.banquepopulaire.fr%3A443%2Fcyber%2Fibp%2Fate%2Fportal%2Finternet.html"]
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:60] autorelease];
[request setValue:@"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; fr; rv:1.9.1) Gecko/20090624 Firefox/3.5" forHTTPHeaderField:@"user-agent"] ;
[request setValue:@"http://www.occitane.banquepopulaire.fr/" forHTTPHeaderField:@"referer"] ;
[request setValue:@"gzip,deflate" forHTTPHeaderField:@"Accept-Encoding"] ;
NSData *dataResponse = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error] ;
if (error) {
NSLog (@"Erreur : %@", [error localizedDescription] ) ;
return ;
}
NSLog(@"La reponse 1 - (POST): \n%@%@", [response allHeaderFields], [[[NSString alloc] initWithData:dataResponse encoding: NSASCIIStringEncoding] autorelease]) ; |
Partager