I had a similar issue. Finally it turned out that via the URL I requested CSV, but in the headers I've forgotten to change the -H 'Accept: application/json header. So it was really impossible to satisfy both.
-H 'Accept: application/json