I'm trying to create key-value pair using MultivaluedMap
(Jersey 2.9 in Eclipse) but somehow it is not able to find MultivaluedMapImpl()
. What implementation of MultivaluedMap
can I use?
Thanks.
Client client = ClientBuilder.newClient();
WebTarget webtarget =client.target("http://localhost:8080").path("/usr/home/create/");
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
queryParams.add("xyz", abc);
You can use MultivaluedStringMap
class which extends javax.ws.rs.core.MultivaluedHashMap<java.lang.String, java.lang.String>
For Jersey 2.0, query parameters can be defined while declaring WebTarget
using WebTarget.html.queryParam(String, Object...)
There seems to be no need for MultivaluedMapImpl
or MultivaluedHashMap
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With