ASIForDataRequest请求失败

时间:2017-07-20 13:16:34

标签: ios objective-c xcode web-services asihttprequest

我试图在ASIHTTPREQUEST的帮助下调用Web服务, 现在,当webservice调用它时,将直接进入RequestFailed。

下面是我调用请求的代码:

-(void)Submit_Called_For_LoginApi
 {

 ASIFormDataRequest *request1;

 request1 = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",STR_URL_login]]];

 request1.timeOutSeconds = 140;

 [request1 setPostValue:self.txtEmail.text  forKey:@"email"];
 [request1 setPostValue:self.txtPassword.text  forKey:@"password"];

 [request1 setPostValue:@"1"  forKey:@"device_type"];



 NSLog(@"STR_URL_login  email= %@, password=%@, device_token=%@, device_type=1",self.txtEmail.text,self.txtPassword.text);


 [request1 setDidFinishSelector:@selector(requestFinished_login:)];
 [request1 setDidFailSelector:@selector(requestFailed_login:)];


 [request1 setDelegate:self];

    [request1 startAsynchronous];

 //[request1 startSynchronous];


 }

这是我的requestFailed_login

- (void)requestFailed_login:(ASIHTTPRequest *)request
{
    NSLog(@"Request Failed %@",[request responseString]);
    [SVProgressHUD dismiss];

    [appDel UnknownError];

    return;
}

现在我的问题仍然是它不在RequestFinished里面。 我需要做些什么才能解决这个问题?  我应该怎么做才能解决这个错误或问题。

0 个答案:

没有答案