My REST API returns JSON.
I'm currently returning text/plain as the MIME type but it feels funny. Should I be returning application/x-javascript or some other types ?
Second question is with regard to the HTTP status code for error conditions. If my REST API is returning an error state, I am returning as JSON
{ result: "fail", errorcode: 1024, errormesg: "That sucked. Try again!" }
Should the HTTP status code remained at 200 OK ?