2

I'm developing now API for developers feature, which gives users API access to some functions of our product.

All responses are in json format.

HTTP Content-Type header in our server's response is text/plain; charset=utf-8

Should I send one of this:

  • application/json
  • text/x-json
  • text/json

instead of text/plain.

Or for API feature text/plain Content-Type is acceptable?

BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91
  • Possible duplicate of [What is the correct JSON content type?](https://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type) – Helen May 07 '20 at 07:37

2 Answers2

4

I'd use application/json as mentioned in the official JSON spec.

Sophie Alpert
  • 139,698
  • 36
  • 220
  • 238
3

application/json

Brian Campbell
  • 322,767
  • 57
  • 360
  • 340