hi roland, thanks very much for your quick answer. this is very embarassing and i am really sorry for all who maybe lost some time looking into the 'problem'.
4 months ago we rewrote our code and switched from HttpURLConnection (from the JDK) to HttpClient. the one system affected by the problem had somehow not yet been 'migrated' to the new classes .... and it took me a long while to realize. sometimes one just starts searching from the wrong end ... now that this system is actually using our new classes with httpclient, the problem is no more. so again, sorry for this! cheers alessandro -----Original Message----- From: Roland Weber [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 6:19 PM To: HttpClient User Discussion Subject: Re: multiple parameters with same name in POST request Hello Alessandro, > i use PostMethod to send a post request with a bunch of parameters and > have tried both ways to fill the request body: > > postMethod.addParameter(String name, String value) and > postMethod.setRequestBody(NameValuePair[] nameValuePairs) > > as long as at least two parameter names are different, everything > works fine. i can verify with tcpdump that the request actually > contains all name=value pairs separated by '&' characters. > > the problem: > if the request only contains parameters with the same name, then in > tcpdump i see all the name=value pairs, but no separating '&' > characters. I've taken a short look at the HttpClient code. The parameters are kept in a Vector, and the only check I've found regarding the name is a check for null. What data structure are you using when collecting the parameter set? You could also try to write a test case that exhibits the problem. If it's in HttpClient, we'll fix it. hope that helps, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
