Question

I am doing an application in which I am uploading the images to twitpic. It works fine the first time. But if I try to upload the next image within that minute itself, it shows a 401 error. If I try again after waiting for a minute, it gives a 200 response and works fine. Why is this happening? Can I send images continuously to twit pic without any interruption?

Was it helpful?

Solution

Well the documentation of TwitPic states that there is 500 call limit on the API. And the 401 will happen only if you do supply the correct Auth header.

My guess is that there is something wrong with the auth header, it might be due to caching. If you use NSURLConnection nochache paramter:

NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top