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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…