2014-09-21 42 views
1

我试图配置一个请求到http://where.yahooapis.com/v1/places.q(name_here);count=50?...。 不是最好的解决办法,我想,但我想翻新查询参数

@GET("/v1/{location}") 
Places getLocations(@Path("location") String locationName); 

,并通过有

getLocations("places.q(" + locationName + ");count=50"); 

但它仍然没有为字符串工作();被翻译成%28%29%3B

你能提出任何解决方案吗?这将是更好的dinamycally只修改name_here部分,像

@GET("/v1/places.q({location});count=50) 

如果它是不可能怎么做我必须要通过符号();以便它们正确转换?

+0

* @get(“/ v1/places.q({位置}); count = 50”是否存在问题)位置getLocations(@Path(“location”)String locationName); *? – Ayzen 2014-09-21 09:53:04

回答

0

我只是想

@GET("/v1/places.q({location});count=50") 
Places getLocations(@Path("location") String name) 

晚了一点,它工作正常。我以为它会插入类似“/”或修改它,但它确实是我需要的。

+0

另外值得注意的是,你可以使用'@ EncodedPath'来跳过特殊字符的编码。 – 2014-09-21 19:47:30