[Answered ]-DRF Imagefield upload responds with html template instead of JSON

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

Leave a comment