Spring-cloud-netflix: spring-cloud-feign not support POST request entity

Created on 28 Nov 2016  路  1Comment  路  Source: spring-cloud/spring-cloud-netflix

@FeignClient(name="adhoc", url = "http://localhost:8288/adhoc/rest")
...
@RequestMapping(value = "sql", method = RequestMethod.POST)
JSONArray query(@RequestParam("sql") String sql) { ... }

I expect the request uri is 'http://localhost:8288/adhoc/rest/sql', and 'sql' param in the http entity.
But spring-cloud-feign change the uri to 'POST /sql?sql=select+count%28*%29+from+city'.

Most helpful comment

I think you should use '@RequestBody' instead of '@RequestParam'.

>All comments

I think you should use '@RequestBody' instead of '@RequestParam'.

Was this page helpful?
0 / 5 - 0 ratings