API Testing · Middle · Question 53 of 75

Why check that error responses have the right Content-Type?

Show the answer

Correct answer: Clients parse errors by type; HTML errors break JSON clients

Explanation

Proxies and frameworks often return HTML error pages. A JSON client then fails with a parse error instead of showing the message.

Further reading

Problem with a question

API Testing · Middle · question 53

Test yourself

Take the API Testing · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz