spring发送 content-type=application/x-www-form-urlencoded 和普通请求不太一样。
@FeignClient( name = "ocr-api", url = "${orc.idcard-url}", fallbackFactory = OcrClientFallbackFactory.class ) public interface OcrClient { @PostMapping( value = "/v1/demo/idcard", headers = {"content-type=application/x-www-form-urlencoded"} ) OcrBaseResponse<IdCardResponse> getIdCarInfo(@RequestBody MultiValueMap<String, Object> request); }
其他方式比如: application/json;charset=UTF-8 可以 OcrBaseResponse<IdCardResponse> getIdCarInfo(@RequestBody Map<String, String> request);
但是 content-type=application/x-www-form-urlencoded 的就得用 MultiValueMap
标签:www,java,Fegin,form,content,application,urlencoded,type From: https://www.cnblogs.com/init-007/p/17545023.html