Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I've just noticed that my api queries are failing in JSON parsing, because of API Site shows offline HTML Page.

alt text

I wish it would return a valid JSON response, instead of HTML Page.

share|improve this question
15  
+1 This should be fixed for sure. –  Nathan Osman May 25 '10 at 3:57
    
hmm..... needs a bump? –  Sky Sanders Feb 12 '12 at 23:56
add comment

1 Answer

While this would indeed be ideal for planned outages, your code and/or libraries & dependencies should be able to handle this elegantly, lest you get bitten by the unplanned outages.

share|improve this answer
    
shouldn't you just be able to check the response code? –  Carson Myers May 28 '10 at 6:53
1  
Exactly. That, and set a reasonable timeout for the request. No reason to go crazy on the server side. –  Greg Hurlman May 29 '10 at 22:36
2  
@carson - jsonp implementations have a very limited and platform inconsistent ability to respond to non-200 responses, basically making a non-200 response a black hole leaving an ambiguous and artificial timeout the only option. –  Sky Sanders Jul 16 '10 at 8:10
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .