I’ve been trying to make a http call with PATCH verb with open-cloud-feign but the first error I got was
Invalid HTTP method: PATCH executing PATCH
I did some research and found out that, by default, feign does nots support PATCH and it was recommended to use another client like OkHttp. So I added this dependency
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-okhttp</artifactId>
</dependency>
And also I updated my Feign Configuration
@Bean
public Client feignClient(@Value("${http.proxy-host}") String host, @Value("${http.proxy-port}") int port) {
return new OkHttpClient.Proxied(null, null, new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)));
}
Also I added this couple of configurations in my config file
spring:
cloud:
discovery:
enabled: false
openfeign:
okhttp:
enabled: true
feign:
okhttp:
enabled: true
Even with these changes, I still get the same error. So my question is if I am missing anything else or if there is another way to do HTTP PATCH requests.
PS: I am using spring-cloud-starter-openfeign:4.1.3 with JDK17
Thanks in advance,