RE: [HttpClient] Post parameters

2002-06-05 Thread Jonathan Carlson
Hi Marc, You asked for suggestions. As I said in my previous note, chaining to other instances of HttpMethod would probably help improve the readability and maintainability of the HttpMethodBase class. Here are more specifics on the implementation I would suggest: 1) Have an ivar defined som

RE: [HttpClient] Post parameters

2002-06-05 Thread Jonathan Carlson
Method class > internally, send > that request and then copy the response data from the > temporary GET method > back into the original POST method got in the first > place. If anyone has > any better ideas I'd love to hear them. > > Marc Saegesser > > > ---

RE: [HttpClient] Post parameters

2002-06-04 Thread Marc . Saegesser
Saegesser > -Original Message- > From: Jonathan Carlson [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 03, 2002 4:17 PM > To: [EMAIL PROTECTED] > Subject: [HttpClient] Post parameters > > > After experienced undesired behavior and looking at the > code it appears that

RE: [HttpClient] Post parameters

2002-06-04 Thread Xiaowei Jiang
There are two methods, setQueryString and setRequestBody, they are different. -Original Message- From: Rainer Klute [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 12:29 AM To: Jakarta Commons Developers List Cc: Rainer Klute Subject: Re: [HttpClient] Post parameters >

Re: [HttpClient] Post parameters

2002-06-04 Thread Rainer Klute
>in PostMethod, there is a method called setRequestBody. You can use that to >solve your problem That is not equivalent. I am struggling with a site that wants some parameters in the POST request's body and others in the query string. As far as I can tell from the relevant RFCs there is nothi

RE: [httpclient] PostMethod.setRequestBody (was RE: HttpClient Post)

2002-04-24 Thread Waldhoff, Rodney
I just committed changes along these lines: /** * @throws IllegalStateException if request params have been added */ public void setRequestBody(String body) { if(!parameters.isEmpty()) { throw new IllegalStateException("Request parameters have already been added."); } requestBody

Re: [httpclient] PostMethod.setRequestBody (was RE: HttpClient Post)

2002-04-24 Thread Rainer Klute
"Waldhoff, Rodney" <[EMAIL PROTECTED]> wrote: > >Re: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8458 > >It's not entirely clear to me how the contract should work between >setRequestBody and setParameter. Both are trying to set the body for the >POST request, and doing so in incompatible wa

Re: HttpClient Post

2002-04-24 Thread Rainer Klute
"Waldhoff, Rodney" <[EMAIL PROTECTED]> wrote: >class MyPostMethod extends PutMethod { > public String getName() { return "POST"; } >} > >does what you're looking for, I think. Oh yes! This seems to be the most obvious, straight-forward and object-oriented solution. :-) Seriously, HttpMethodBas

RE: [httpclient] PostMethod.setRequestBody (was RE: HttpClient Post)

2002-04-24 Thread Waldhoff, Rodney
> According to the documentation, an exception is > to be thrown if the request body is set and > addParameter is to be called. This makes no sense, > as there is no way to set the body... Not exactly. There's a protected method of PostMethod called generateRequestBody, which generates and re

RE: HttpClient Post

2002-04-24 Thread Amir D. Kolsky
002 3:01 PM To: 'Jakarta Commons Developers List ' Subject: RE: HttpClient Post > When the HTTP header is built, getName > is used to figure out which method it > is, right? Right, so that: class MyPostMethod extends PutMethod { public String getName() { return "POST&qu

RE: HttpClient Post

2002-04-24 Thread Waldhoff, Rodney
> When the HTTP header is built, getName > is used to figure out which method it > is, right? Right, so that: class MyPostMethod extends PutMethod { public String getName() { return "POST"; } } does what you're looking for, I think.

RE: HttpClient Post

2002-04-23 Thread Amir D. Kolsky
ailto:[EMAIL PROTECTED]] Sent: Wed, April 24, 2002 3:00 AM To: 'Jakarta Commons Developers List' Subject: RE: HttpClient Post The TestWebappMethods TestCase has examples of using POST (and PUT). See http://cvs.apache.org/viewcvs/jakarta-commons/httpclient/src/test/org/apache /com

RE: HttpClient Post

2002-04-23 Thread Waldhoff, Rodney
The TestWebappMethods TestCase has examples of using POST (and PUT). See http://cvs.apache.org/viewcvs/jakarta-commons/httpclient/src/test/org/apache /commons/httpclient/TestWebappMethods.java?rev=1.3&content-type=text/vnd.vie wcvs-markup This old thread http://marc.theaimsgroup.com/?l=jakarta-co

HttpClient Post

2002-04-23 Thread Amir D. Kolsky
Hi all, I am trying to HttpClient to Post a request with an XML body to some host/path. I looked through the JUnit test cases, expecially those dealing with testing the methods, and non of them test POST, is that OK? Where can I find a working example of how to Post a request? I'm losing sleep