i am developing one app which will login to vonage website and do some functions like call froward etc . For that purpose first i am trying to login to vonage website
我没有登录到网站在iphone
2)使用livehttpheader附加实测值Vonage公司的登录URL这些步骤
1)来捕获呼出交请求数据,当我点击sigin
我发现的数据是
用户名=名为myUsername &密码=输入mypassword & redirectingURL =%2Fwebaccount%2Fdashboard%2Fchoose.htm & frontDoorLogin = & goToSelection =来电转驳& loginsubmit等号(=)+在
我得到了我的资料后,我开始在xcode编码,我不知道什么是最好的办法做到这一点,但我搜索了一段时间,然后我试着这样
-(IBAction) buttonpressed {
NSURL *url = [NSURL URLWithString:@"https://secure.vonage.com/vonage-web/public/login.htm"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setValue:@"myuser" forKey:@"username"];
[request setValue:@"mypass" forKey:@"password"];
[request setValue:@"/webaccount/dashboard/choose.htm" forKey:@"redirectingURL"];
[request setValue:@"" forKey:@"frontDoorLogin"];
[request setValue:@"callforwarding" forKey:@"goToSelection"];
[request setValue:@"Sign+In" forKey:@"loginsubmit"];
[request setDelegate:self];
[request startAsynchronous];
}
- (void)requestFinished:(ASIFormDataRequest *)request
{
// Use when fetching text data
NSString *responseString = [request responseString];
UIAlertView *alert= [[UIAlertView alloc] initWithTitle:@"Hmm" message:@"http works" delegate:self cancelButtonTitle:@"okay" otherButtonTitles:nil];
[alert show];
[alert release];
NSLog(@"Output = %@",responseString);
}
- (void)requestFailed:(ASIFormDataRequest *)request
{
NSError *error = [request error];
UIAlertView *alert= [[UIAlertView alloc] initWithTitle:@"fail" message:@"http fails" delegate:self cancelButtonTitle:@"okay" otherButtonTitles:nil];
[alert show];
[alert release];
}
但是当我在模拟器中运行应用程序时,它崩溃了。
我在做数据发布的正确方法吗?有没有其他方法可以做到这一点?
任何一个可以帮助我在这个问题上
我使用asihttprequest库
在此先感谢
问候
编辑:我盲目的错误,我种SETVALUE代替setpostvalue,这将解决这个问题:)
调试器中的错误是什么? – Jordan 2010-10-23 00:00:23
我试着在调试器崩溃后[请求setValue:@“/ webaccount/dashboard/choose.htm”forKey:@“redirectingURL”]; 它似乎我不能使用这种方法发布,任何想法? – appleDE 2010-10-23 06:04:22