#define USERAGENT @"Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3"
NSMutableURLRequest *restRequest = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReloadIgnoringCacheData
timeoutInterval:30.0];
[restRequest setValue:USERAGENT forHTTPHeaderField:@"User-Agent"];
-(NSURLRequest *)connection:(NSURLConnection*)connection
willSendRequest:(NSURLRequest*)request
redirectResponse:(NSURLResponse*)redirectResponse{
NSMutableURLRequest *newReq = [request mutableCopy];
[newReq setValue:USERAGENT forHTTPHeaderField:@"User-Agent"];
return [newReq autorelease];
}