开发者

Resteasy/JAX-RS URL Encoding @PATH

开发者 https://www.devze.com 2023-04-06 07:24 出处:网络
I am trying to build a client for a restful webservice with Resteasy. The issue is with my client code(below)

I am trying to build a client for a restful webservice with Resteasy. The issue is with my client code(below)

@Path("solr")
public interface TestClient{

    @GET
    @Path(value="select?indent...")
 开发者_如何学Python   @Produces("application/xml")
    ClientResponse<String> getStuff();
}

The problem is that the ? in the @Path annotation is automatically URL encoded to a %3F. This is in keeping with the javadocs here, but it's causing me to get 404 errors. I tried overriding this with the encode=false here but that just creates compiler errors. Is there a way to override or escape this?


Why do you think you need a ? in the Path? It seems like @QueryParam is what you'd want instead. See http://docs.jboss.org/resteasy/docs/1.0.1.GA/userguide/html/RESTEasy_Client_Framework.html

0

精彩评论

暂无评论...
验证码 换一张
取 消