rdm-app icon indicating copy to clipboard operation
rdm-app copied to clipboard

API Content-Type

Open fxedel opened this issue 8 years ago • 3 comments

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).

fxedel avatar Oct 15 '17 16:10 fxedel

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 avatar Oct 15 '17 17:10 peternewman

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

peternewman avatar Oct 15 '17 17:10 peternewman

I've finally pushed and opened my PR #186

peternewman avatar Apr 14 '18 21:04 peternewman