NSString* url = [NSStringstringWithFormat:@"%s?mt=1&qt=6045&mobilekey=%@",gURLHEADER.getData(), [[UIDevice currentDevice]uniqueIdentifier]];
NSURL *c_url = [NSURL URLWithString:url];
NSMutableURLRequest *postRequest = [[NSMutableURLRequest alloc]initWithURL:c_url];
[postRequest setHTTPMethod:@"POST"]; [postRequestsetValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[postRequest setTimeoutInterval:60];
NSHTTPURLResponse* response = nil;
NSData *resData = nil;
NSInteger code = 0;
int index = 0;
while (index < 2)
{
resData= [NSURLConnection sendSynchronousRequest:postRequestreturningResponse:&response error:nil];
code = [response statusCode];
if (code == 200)
{
break;
}
index++;
}
[postRequest release];
if (resData)//服务器返回的数据
{
//用xml方式解析resData
}