0

Here is my Feign interface definition:

@RequestMapping(value = "/group/list", method = RequestMethod.POST)
    List<AdvertGroupVO> list(AdvertGroupVO vo,
                             @RequestParam("page") int page,
                             @RequestParam("size") int size);

Although this is a POST request, but feign still puts page and size into URL instead of request body:

2016-09-03 17:59:39 [DEBUG] o.a.coyote.http11.InternalNioInputBuffer - Received [POST /group/list?page=1&size=8&groupId=6 HTTP/1.1
Accept: */*
User-Agent: Java/1.8.0_45
Host: 10.236.65.24:8080
Connection: keep-alive

]

I cannot figure out why

Neo
  • 2,196
  • 5
  • 32
  • 58

1 Answers1

2

Parameters annotated with @RequestParam will be added to URL query string regardless of the HTTP method. Only parameter with no annotation will be added to request body and you must customize your own Feign Encoder.

Neo
  • 2,196
  • 5
  • 32
  • 58
  • 1
    Could you put example how you make custom Encoder. I've the same problem but can't understand how to solve it. – koa73 Feb 23 '17 at 22:33