假如远程api,produces为"application/json"
@GetMapping(value = "/test", produces = "application/json")
public ResponseObject test(String test) {
System.out.println(test);
return ResponseObject.success(test);
}
那么在feign中
@Component
@FeignClient(url = "${host}", name = "api")
public interface ApiFeignClient {
@GetMapping(value = "/test", consumes = "application/json")
ResponseObject test(@RequestParam("test") String test);
}
是用consumes还是produces?
服务声明和接口声明应该是一致的,produces -> produces, consumes -> consumes