Is there a Java method that encodes a collection of parameters as a URL query component?

后端 未结 5 922
逝去的感伤
逝去的感伤 2021-01-12 12:56

Is there a widely-used Java library that does something like what dojo.objectToQuery() does? E.g. (assuming the use of HttpCore\'s HttpParams object, but any key-value mappi

5条回答
  •  无人及你
    2021-01-12 13:48

    If you have JAX-RS there is javax.ws.rs.core.UriBuilder; other than that you should primarily be aware of URLEncoder and URLDecoder which will at least encode the pieces of the parameter list.

提交回复
热议问题