Similar with posting a form in PostMethod, you can use the NameValuePair[] to hold the parameters and set the parameters with HttpMethodBase#setQueryString(NameValuePair[] params).
-----Original Message----- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 17, 2007 2:46 AM To: [email protected] Subject: how to set parameters in doGet method Hi Suppose i have an URL http://myhost:8080/myServlet?test=abc&test1=klm Now i need to set parameters test and test1, the code i have is HttpClient client = new HttpClient(); GetMethod method = new GetMethod("http://myhost:8080/myServlet"); method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3, false)); int statusCode = client.executeMethod(method); if (statusCode != HttpStatus.SC_OK) { System.err.println("Method failed: " + method.getStatusLine()); } InputStream is =method.getResponseBodyAsStream(); Now how do i add test and test1 parameters to be passed to the URL Ashish --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
