0

Trying to get Patch working with my feign client. Ive added

io.github.openfeign:feign-httpclient:jar:10.2.3

to the classpath but still get an exception when trying to make the Patch call

Invalid HTTP method: PATCH executing PATCH...

Feign client method looks like this

@PatchMapping("/devices")
AppDevice patchDevice(@RequestHeader(AUTHORIZATION) String apiKey, AppDevice device);

Doubt it matters but Im using spring boot with the following in my pom

...
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.8.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
  </parent>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>Greenwich.SR3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
...

    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-openfeign</artifactId>
    </dependency>

    <dependency>
      <groupId>io.github.openfeign</groupId>
      <artifactId>feign-httpclient</artifactId>
    </dependency>

...

Marquis Blount
  • 7,585
  • 8
  • 43
  • 67

1 Answers1

0

<dependency>
  <groupId>io.github.openfeign</groupId>
  <artifactId>feign-httpclient</artifactId>
</dependency>

This dependency didn't help me to.
Feign client doesn't support PATCH method call and for resolving this problem you should use other dependency:

<dependency>
    <groupId>io.github.openfeign</groupId>
    <artifactId>feign-okhttp</artifactId>
    <version>10.2.0</version>
</dependency>

More details i wrote with gradle dependency and example configuration here: https://stackoverflow.com/a/63580015/8999575

Olexander Yushko
  • 2,434
  • 16
  • 16