Skip to content

FeignClient send post request instead of get #832

@Fortage

Description

@Fortage

I use spring cloud version 2021.0.3 also tried to use version 2021.0.4
I have FeignClient "DigitalCashTokenFeign" and I'm trying to send a request to my other service

Example:

@FeignClient(
    value = "digital-cash",
    primary = false,
)
interface DigitalCashTokenFeign {
    @GetMapping("/digital-cash/internal/api/v1/digital/token/{deviceId}")
    fun getDigitalCashToken(@PathVariable deviceId: String): ResponseEntity<String>
}

Also i tried use (@PathVariable("deviceId") deviceId: String) but nothing has changed

when calling this method i get service side error:
2023-02-16 21:29:56.360 WARN [digital-cash,faee331c0ae7e791,8389463eec20bd06] 44424 --- [nio-9876-exec-4] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported]

and accordingly in my service I get the error
[Request processing failed; nested exception is feign.FeignException$MethodNotAllowed: [405] during [GET] to [http://digital-cash/digital-cash/internal/api/v1/digital/token/211671606232197] [DigitalCashTokenFeign#getDigitalCashToken(String)]: [{"timestamp":1676564996373,"status":405,"error":"Method Not Allowed","path":"/digital-cash/internal/api/v1/digital/token/211671606232197"}]] with root cause

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions