Never mind figured it out. There was case issue, only visible to me using tcpdump :)
On Wed, Jul 20, 2011 at 4:04 PM, Mohit Anchlia <[email protected]> wrote: > I have this servelet code that gets parameter on post. Something like > request.getParameter("requestType"); > > On the client I do this: > > List<NameValuePair> pairs = new ArrayList<NameValuePair>(); > > for (String s : attrib.keySet()){ > System.out.println(s + attrib.get(s)); > pairs.add(new BasicNameValuePair(s, attrib.get(s))); > } > > try { > httppost.setEntity(new UrlEncodedFormEntity(pairs,HTTP.UTF_8)); > HttpResponse response = httpclient.execute(httppost); > HttpEntity entity = response.getEntity(); > if (entity != null) { > System.out.println(EntityUtils.toString(entity)); > } > > > attrib is name value and I name sure that it's the first parameter is > requestType and second it's value. But servlet still is not able to > get the parameter from the client. Not sure what's incorrect in above > code. > > I created simple HTML form and that seem to work well. > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
