it works without making any changes in the util.py . Earlier, I was doing it using request_wants_json, but in that case we have to make changes in the util.py for any header type other than text/html and application/json.