Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 67895 invoked from network); 3 Jun 2003 23:13:48 -0000 Received: from unknown (HELO bigcow.intraephox.ephox.com) (202.138.204.102) by daedalus.apache.org with SMTP; 3 Jun 2003 23:13:48 -0000 Received: by bigcow.intraephox.ephox.com with Internet Mail Service (5.5.2653.19) id ; Wed, 4 Jun 2003 09:13:55 +1000 Message-ID: <8D585857D762F741A47C1E1597FEAD3003B622@bigcow.intraephox.ephox.com> From: Adrian Sutton To: 'Jakarta Commons Users List' Subject: RE: [HttpClient] What method should be used to add params to a po st met hods Date: Wed, 4 Jun 2003 09:13:46 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Nitin, There are a few reasons to use an array over a list (particularly a custom list type): * Array's enforce type. You can only pass in NameValuePair's * Array's don't require the creation of another class which just increases the size of HttpClient. * Array is a lowest common denominator so people who choose to use Vectors, Arrays or Lists can easily use the method (use the toArray() method for Lists and Vectors). * Array's are available in JRE 1.1 which we actually have someone using, though generally HttpClient requires 1.2. * Changing to a list would require an interface change with no real reason for the change and that tends to annoy users. :) Plus, you can create an array on one line but you can't do the same for a list. Regards, Adrian Sutton, Software Engineer Ephox Corporation www.ephox.com -----Original Message----- From: Verma, Nitin (GECP, OTHER, 529706) [mailto:NITIN.VERMA@APPL.GE.COM] Sent: Tuesday, 3 June 2003 10:32 PM To: Jakarta Commons Users List Subject: RE: [HttpClient] What method should be used to add params to a po st met hods Wouldn't it be better to have method.setRequestBody(NameValuePairList list) ? where NameValuePairList implements java.util.List (or extends a List Type) -----Original Message----- From: Verma, Nitin (GECP, OTHER, 529706) Sent: Tuesday, June 03, 2003 5:31 PM To: Jakarta Commons Users List Subject: RE: [HttpClient] What method should be used to add params to a po st met hods Thanx it works :-) method.setRequestBody(new NameValuePair [] { new NameValuePair( "", "" ) }); -----Original Message----- From: Norrod, Dennis G Mr Veridian-MRJ [mailto:Dennis.Norrod@DET.AMEDD.ARMY.MIL] Sent: Tuesday, June 03, 2003 5:21 PM To: Verma, Nitin (GECP, OTHER, 529706); 'Jakarta Commons Users List ' Subject: RE: [HttpClient] What method should be used to add params to a po st met hods Hi Nitin, Docs say setRequestBody(NameValuePair[]). I use MultipartPostMethod exclusively (so far), which has not (yet?) deprecated the addParameter methods. HTH. Later. Dennis -----Original Message----- From: Verma, Nitin (GECP, OTHER, 529706) To: Jakarta Commons Users List Sent: 6/3/03 7:10 AM Subject: RE: [HttpClient] What method should be used to add params to a po st met hods Anyone any clue? -----Original Message----- From: Verma, Nitin (GECP, OTHER, 529706) Sent: Tuesday, June 03, 2003 1:44 PM To: Jakarta Commons Users List Subject: [HttpClient] What method should be used to add params to a post met hods PostMethod method = new PostMethod(url); method.setParameter( "","" ); method.addParameter(new NameValuePair("", "")); method.addParameter("", ""); are deprecated as for my dependency commons-httpclient 2.0-alpha3 http://jakarta.apache.org/commons/httpclient/ What method should be used? <>