What MIME type if JSON is being returned by a REST API?

前端 未结 6 1637
终归单人心
终归单人心 2020-12-07 22:35

My REST API returns JSON.

I\'m currently returning text/plain as the MIME type, but it feels funny. Should I be returning application/x-javascript or s

6条回答
  •  孤街浪徒
    2020-12-07 23:09

    I prefer to reply with both an HTTP error status and application specific payload.

提交回复
热议问题