2👍
✅
That’s content negotiation and the preferred renderer when submitting forms is HTML because that’s consistent with browsers.
If you want a JSON response, you should make sure your request set the headers so it gets JSON. In other words, you need to set the Accept
headers to application/json
Source:stackexchange.com