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

前端 未结 6 1631
终归单人心
终归单人心 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 22:50

    The MIME type of JSON is

    application/json

    http://www.ietf.org/rfc/rfc4627.txt

    http://www.iana.org/assignments/media-types/application/

    More specifically here:

    http://www.ietf.org/rfc/rfc4627.txt

提交回复
热议问题