如何在json响应中设置内容类型?

我的控制器中有以下代码:

render json: gerencia.pay_charge(params: params, body: payment)

我的响应头返回如下内容:

Cache-Control:max-age=0, private, must-revalidate
Connection:keep-alive
Content-Type:application/json; charset=utf-8

如何为其设置content-type:

Content-Type:text/html; charset=UTF-8

转载请注明出处:http://www.intsu.net/article/20230428/1900406.html