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
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
>
> > ---
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
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
>
>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
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
"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
"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
> 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
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
> 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.
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
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
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
14 matches
Mail list logo