【发布时间】:2016-09-19 19:32:40
【问题描述】:
你们好吗,我需要更改 BadRequest() 返回的响应消息。
当我使用这样的请求时,BadResquest("error: you can not pass these values")
我希望我的 api 返回如下内容:
{"error: you can not pass these values"}
但端点重新调整了这个:
{"Message":"error: you can not pass these values"}
我不想在回复中出现“消息”一词,是否有任何形式可以覆盖或更改回复?
【问题讨论】:
标签: c# asp.net asp.net-web-api asp.net-web-api2 webapi2