38

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

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

2
  • hmm..... needs a bump? Commented Feb 12, 2012 at 23:56
  • 2
    The image/screenshot is gone and not archived anywhere. Please edit in the correct image. Commented Jul 13, 2014 at 0:10

1 Answer 1

5

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.

3
  • shouldn't you just be able to check the response code? Commented May 28, 2010 at 6:53
  • 1
    Exactly. That, and set a reasonable timeout for the request. No reason to go crazy on the server side. Commented May 29, 2010 at 22:36
  • 3
    @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. Commented Jul 16, 2010 at 8:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.