Sending multiple query parameters from Client - Cascaded or Iterated programming

You can see the following sample if you want to send multiple query parameters from the client side to the server.

About this task

Note: Normally, the way to put multiple query parameters in a WebTarget object is by using the following cascaded programming mode: response =, value).queryParam(key, value).queryParam(key, value).request.get(); 
However, in some cases, the cascaded programming mode does not apply because the number of key value pairs is flexible and cannot be predicated. For these cases, you can use the following iteration based programming mode:
Map<String, String> queryStrings;
...  target =;
	for (String key: queryStrings.keySet()){		
	  	String value = queryStrings.get(key);
			target = target.queryParam(key, value);  //It is important to know queryParam method won't update current WebTarget object, but return a new one. 
	} response = target.request().get();