0

I use Feign in my micro service. Sometimes my code gets (as response from remote client) 200 OK with body, but sometimes 204 without and I got here NPE. Is it possible to set body by default? or check whits is respose code and dont wait for body payload? This is my code

@FeignClient(name = "ppppp", url = "${ppppp.url}")
public interface PClient {
    @PostMapping("/search")
    ResponseEntity<MyResult> searchAll(@RequestHeader("User") String user);
}
EK.
  • 2,890
  • 9
  • 36
  • 49

1 Answers1

0

You can extend from ResponseEntityDecoder, customize your own feign client and implement your own Decoder where you can do whatever you want with the response.

Paplusc
  • 1,080
  • 1
  • 12
  • 24