I am writing a web service that accepts only json, and also outputs only json.
So I need to return the appropriate status code if any other format is requested.
It appears that I have two choices:
- 406 - Not Acceptable
- 415 - Unsupported Media Type
It would be great if someone could enlighten me as to the semantics of the two codes.
See Question&Answers more detail:os