Skip to content

Change default content_type in API from text/plain to application/json

6 years ago I put content_type :txt, "text/plain" in lib/api/api.rb as a temporary fix to the bug 3c742dad.

This causes a side effect of API endpoints to support .txt format whenever we want it or not. Since we don't encourage nor document this behavior, its time to change it to application/json.

Example of the non desired behavior can be endpoint like this: https://gitlab.com/api/v4/users/1.txt

Timeline:

Edited by Dmytro Zaporozhets (DZ)