0

Hi in my application I am using NSURLConnection delegate metods to get a response from the server.Here what is happening is when ever I send a request to the server for the first time I am getting response immediately.After that first request if I send same request to the server again immediately I am getting the response as null. But if i leave the ipad aside after sometime I am getting the response can you please let me know is there any time limit needed between the requests while sending to the server using NSURLConnection delegate methods.Please help me to resolve this issue.

Thanks in advance.

user1118321
  • 25,567
  • 4
  • 55
  • 86
Naresh
  • 363
  • 1
  • 18
  • Perhaps the server has a minimum time between requests. Run an network sniffer like Charles Proxy to find out what is really happening. – zaph Feb 13 '14 at 05:08
  • send extra parameter in your request as time=[[NSDate date]timeIntervalSince1970]...It should work...... – Piyuesh Feb 13 '14 at 05:09
  • send a timestamp parameter to make the server think that's a different request – cloudycliff Feb 13 '14 at 05:11
  • Hi cloudycliff tahnks for your reply. May i know that time stamp is one parameter which I can pass along with exicting parameters or have to set to NSURLRequest object or NSURLConnection object. Please let me clear this. – Naresh Feb 13 '14 at 05:19
  • You can just add it on the end of the query string. Note that may or may not solve your problem. The concept is to fool the server. In any event the time issue is not iOS and/or `NSURLConnection`. – zaph Feb 13 '14 at 05:24
  • When you get a "null" response, what is the response code, that may tell you what the problem is. – zaph Feb 13 '14 at 05:27

0 Answers0