Search code examples
javahttpjettyjetty-9

How to add query parameters using Jetty HttpClient


how can I pass parameters in the URL using Jetty 9 client Request? I tried the following but it did not work:

String url= http://localhost/myApp    
Request request = httpClient.newRequest(url);
request.param("param","value");

I want to add parameters in the URL to be like the following when I send my request:

http://localhost/myApp?param=value

Solution

  • The code is working as it is! My problem was a wrong value in the parameter.