Hi,

I have a servlet which accepts only PUT requests. Bu when I'm send the parameters like below, those are not read in the Servlet.

       HttpClient httpClient = null;
			HttpResponse response = null;
			HttpPut httpPut = null;
			StatusLine statusLine = null;
			try { 
				httpPut = new HttpPut("http://localhost:8080/Test_app/details");
 
				List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
				nameValuePairs.add(new BasicNameValuePair("customerId", URLEncoder.encode("123456","UTF-8")));
				nameValuePairs.add(new BasicNameValuePair("productId", URLEncoder.encode("pp12","UTF-8")));
				httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairs));
 
				HttpParams httpParams = new BasicHttpParams();
				int timeOut = 0;
				HttpConnectionParams.setConnectionTimeout(httpParams, timeOut);	
				httpClient = new DefaultHttpClient(httpParams);
 
			        response = httpClient.execute(httpPut);

But if I append the parameters then those are available in the Servlet. Below code works fine
 HttpClient httpClient = null;
			HttpResponse response = null;
			HttpPut httpPut = null;
			StatusLine statusLine = null;
			try { 
				httpPut = new HttpPut("http://localhost:8080/Test_app/details?customerId=122&productId=pp");
 
				HttpParams httpParams = new BasicHttpParams();
				int timeOut = 0;
				HttpConnectionParams.setConnectionTimeout(httpParams, timeOut);	
				httpClient = new DefaultHttpClient(httpParams);
 
			        response = httpClient.execute(httpPut);


Also how do I send an xml in request body for the same PUT request.

Thanks for the help