业务
创建优惠券
spring mvc controller
@RequestMapping(method = RequestMethod.POST)
public Result<String> create(@Valid @RequestBody CouponModel model)
但此时默认只支持Content-Type: application/json
而客户端同事要求支持Content-Type: application/x-www-form-urlencoded
, 但似乎没办法同时支持application/json
和application/x-www-form-urlencoded
?
能实现什么Spring接口使得能在进入Controller方法前将application/x-www-form-urlencoded
的请求转成application/json
的形式吗?
记得Request Mapping里有指定content type的参数