Reputation: 2226
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
Upvotes: 0
Views: 2819
Reputation: 2226
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.
Upvotes: 2