更新时间:2023-10-15 08:54:22
在 Rails 3 中,你可以跳过 header 和 @request.env
的东西,只需添加一个 format
> 后调用的参数,例如:
In Rails 3, you can skip the header and @request.env
stuff and just add a format
parameter to your post call, e.g.:
post :create, format: :json, param: 'Value of Param'