NSURL *url = [NSURL URLWithString:@"someurl"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:year1 forKey:@"year"];
[request setPostValue:appy_level forKey:@"appy_level"];
[request setPostValue:reasons forKey:@"reasons"];
[request setPostValue:country forKey:@"country"];
[request setPostValue:city forKey:@"city"];
[request setPostValue:sex forKey:@"sex"];
[request setRequestMethod:@"POST"];
[request setValidatesSecureCertificate:NO];
[request setDelegate:self];
[request startAsynchronous];
NSLog(@"response -%@",[request responseString]);
[self dismissModalViewControllerAnimated:YES];
}
- (void)requestFinished:(ASIHTTPRequest *)request
{
NSString *response = [request responseString];
NSLog(@"%@",response);
}
任何想法爲什麼此代碼返回(空)我的意思是響應爲空?這個requestFinised:方法不工作,即使我寫[requestsetDidFinishSelector:@selector(requestFinished)]; 方法too.I現在confudsed。問題與響應asihtttprequest
好我現在嘗試,如果我是正確的,方法不會打電話。所以完成從未顯示。 –
這很奇怪,因爲我在我的應用程序中使用ASIFormDataRequest並且它工作正常...您是否檢查了您的URL? – akashivskyy
是的隊友我放棄使用它,我用xml重寫我的php我想我應該至少得到迴應:D感謝耐心和幫助 –