Nikita Fedyashev
Nikita Fedyashev

Reputation: 19003

API for developers. What Content-Type should I use?

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:

instead of text/plain.

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

Upvotes: 2

Views: 257

Answers (2)

Sophie Alpert
Sophie Alpert

Reputation: 143154

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

Upvotes: 4

Brian Campbell
Brian Campbell

Reputation: 332886

application/json

Upvotes: 3

Related Questions