PlaytikaOSS/feign-reactive

Reactive Feign send POST-request instead of GET

Closed this issue · 0 comments

naysav commented

Hi, i have a maven dependency:
<dependency>
<groupId>com.playtika.reactivefeign</groupId>
<artifactId>feign-reactor-spring-cloud-starter</artifactId>
<version>3.3.0</version>
<type>pom</type>
</dependency>

Also i have GET-method in my @FeignClient class with body (it's need for me):
@RequestMapping(method = RequestMethod.GET, value = "/application",
consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
ApplicationInfoResponse getApplicationInfo(@RequestHeader("correlationId") String correlationId,
@RequestBody ApplicationInfoRequest applicationInfoRequest);

And GET-method in my @RestController class with body
@RequestMapping(method = RequestMethod.GET, value = "/application",
consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
ApplicationInfoResponse getApplicationInfo(@RequestHeader("correlationId") String correlationId,
@RequestBody ApplicationInfoRequest applicationInfoRequest) {...}

ApplicationInfoRequest class:
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class ApplicationInfoRequest {
private Long applicationId;
}

As a result, i get an exception:
feign.FeignException$MethodNotAllowed: [405] during [GET] to [http://localhost:8080/application] [feignException.txt](https://github.com/PlaytikaOSS/feign-reactive/files/11558747/feignException.txt) [OctopusFeignClient#getApplicationInfo(String,ApplicationInfoRequest)]: [{"timestamp":"2023-05-24T20:05:40.325+00:00","status":405,"error":"Method Not Allowed","path":"/application"}]