OpenLightingProject / rdm-app

Code for the rdm.openlighting.org site
http://rdm.openlighting.org
16 stars 11 forks source link

API Content-Type #130

Open fxedel opened 6 years ago

fxedel commented 6 years ago

The JSON and Proto API (e.g. http://rdm.openlighting.org/api/json/1/manufacturers) both return Content-Type: text/plain in their headers. However, common REST APIs (like this) use Content-Type: application/json.

A nice advantage in Firefox is that Content-Type: application/json urls are automatically JSON parsed and prettyprinted (with foldable arrays/objects).

peternewman commented 6 years ago

https://github.com/OpenLightingProject/rdm-app/blob/master/api/json_v1.py#L35

Need to check with rdmprotocol.org that this doesn't affect them when we do it.

"text/json" would be closer to what we already do elsewhere though.

peternewman commented 6 years ago

Actually, it looks like what we do already is wrong and it should be application/json throughout...

peternewman commented 6 years ago

I've finally pushed and opened my PR #186