春云假名@Requestparam名称包含符号[]

时间:2019-02-19 06:38:24

标签: java spring spring-cloud-feign

我尝试创建查询

@FeignClient(name = "geohelper", url = "http://geohelper.info/api/v1")
public interface GeohelperAPI {

@GetMapping(path = "/regions", consumes = "application/json")
GeohelperResponse getRegion(@RequestParam(name = "apiKey") String apiKey, 
                            @RequestParam(name = "locale[lang]") String localeRu,
                            @RequestParam(name = "filter[name]") String region);
}

并且我的requestparams的名称包含符号[和]。

创建的请求类似于

apiKey=somekeysymbols&locale%5Blang%5D=%7Blocale%5Blang%5D%7D&filter%5Bname%5D=%7Bfilter%5Bname%5D%7D

其中的值{locale[lang]}{filter[name]}代替"rightValueStrings"

这是一个错误吗?我如何才能逃脱此[]?

0 个答案:

没有答案