0

I am trying to access one of my URL in my code. It returns the StatusCode as zero.

What is this? could not understand..

Code : calling method

{
ASIHTTPRequest* request = [[MUGatewayHelper sharedGatewayHelper] prepareRequestForURL:requestURL];               
request.delegate = self;                                                                                            
request.didFinishSelector = _didFinishSelector;                                                                     
request.didFailSelector = _didFailSelector;
}

My response(status Message) is 'null' with statuscode of 'zero'

Please guide me. I have tried with some other URL in my code. It works perfectly. I am sure, My Connection code is correct. is there any certification issue in ios device? But If I connect the same URL thorugh ios device safari, i can get the response . Is there any blocking in ASIHttpRequest ? or probelm with server?

Please Guide me. I am totally confunsed,...

Edit on : Feb 11

I have got some invalid SSL certificate exception in the error. But my SSL certificate is original. If the add the cookies value in Firefox, it works. But if add the cookies in ASIHttpRequest , still i am getting the responderstatus is 0. any idea?

Edit on FEb 11 at 9.30

Hi Friends, I have used the GET request in safari,chorme and firefox . it works fine. When I am using the same URL in iphone browser, it returns the 404 exception. incase i am using in the ASIHTtpRequest in the Code, I am getting the exception code status zero. is it specific reason ? Please guide me... I am stuck up much .. Thanks in advance.

Finder
  • 8,259
  • 8
  • 39
  • 54

1 Answers1

3

All the functions to use ASIHttpRequest are present in documentation. your code does not look as per document requirement.
Read the documention of ASIHTTPRequest. It will help.
requestFinished is a delegate method which is invoked when URL returns the response.

AsifHabib
  • 944
  • 9
  • 25
  • Here, I have used some call back mechanisham.. It works fine for one of my request... If i have connected the my client machine, it returns the status code zero.. – Finder Feb 08 '13 at 07:21
  • I have tried with REST-client in firefox.. it did not work. But When I have tried with safari or IE. It returns the response. It GET type request – Finder Feb 08 '13 at 07:25
  • check this, person getting same issue http://stackoverflow.com/questions/4263504/asihttprequest-send-a-weired-status-code-of-zero-not-reaching-the-server – AsifHabib Feb 08 '13 at 07:32
  • Thanks AsifHabib. I have got some invalid SSL certificate exception in the error. But my SSL certificate is original. If the add the cookies value in Firefox, it works. But if add the cookies in ASIHttpRequest , still i am getting the responderstatus is 0. any idea? – Finder Feb 11 '13 at 13:01
  • 1
    Check out the Handling redirection, Cookies, in the Documentation, – AsifHabib Feb 11 '13 at 13:54
  • Hi I have tried to set the cookies in the request. But still it I am getting the status code value as zero. is there any specifice reason ? NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys:@"ARPT", NSHTTPCookieName, @"POQRWNS10.50.4.170CKKWW", NSHTTPCookieValue, @"aaa.ts.net", NSHTTPCookieDomain, @"/", NSHTTPCookiePath,[NSDate dateWithTimeIntervalSinceNow:60*60],NSHTTPCookieExpires,nil]; NSHTTPCookie *cookie = [[[NSHTTPCookie alloc]initWithProperties:properties]autorelease]; [aRequest setRequestCookies:[NSMutableArray arrayWithObject:cookie]]; – Finder Feb 11 '13 at 14:11