REST Content-Type: Should it be based on extension or Accept header?

后端 未结 7 1350
旧时难觅i
旧时难觅i 2020-11-28 22:50

Should the representation(html, xml, json) returned by a RESTful web service be determined by the url or by the Accept HTTP header?

7条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 23:35

    There are problems with using content type... I discussed this on my blog http://shouldersofgiants.co.uk/Blog and finally settled on including the representation in the URI as suggested in RESTful Web Services by Richardson and Ruby

提交回复
热议问题