试图让 Patch 与我的假客户一起工作。我已经添加
io.github.openfeign:feign-httpclient:jar:10.2.3
到类路径,但在尝试进行 Patch 调用时仍然出现异常
无效的 HTTP 方法:PATCH 正在执行 PATCH...
Feign 客户端方法如下所示
@PatchMapping("/devices")
AppDevice patchDevice(@RequestHeader(AUTHORIZATION) String apiKey, AppDevice device);
怀疑这很重要,但我在我的 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>
...