hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christine <christ...@christine.nl>
Subject Re: cannot chanhge execute method for single HttpClient instance
Date Tue, 10 Feb 2009 14:20:23 GMT
On Tue, 2009-02-10 at 04:25 -0800, caffeine zombie wrote:
> If I use the same HttpClient and c executrMethod with a
> getMethod and then a postMethod, the getMethod just gets executed twice. 

your code only shows the PostMethod, there's no definition of a
getMethod. If "method" is a PostMethod, then there's no definition of a
GetMethod.
The proper way to do this is to define a GetMethod named getMethod and a
PostMethod named postMethod, then execute these.

Christine


> Here is my code, is there a way to override the getMethod so the postMethod
> gets done correctly
> 
> many thanks
> 
> 
> HttpClient client = new HttpClient();
> 	    client.getParams().setParameter("http.useragent", "Test Client");
> 	    client.getParams().setParameter("http.connection.timeout",new
> Integer(5000));
> 
> String authToken = null;
> 	    try {
> 
> 	      method.setURI(new
> URI("http://dev-integration-test.dsi.thus.net:3001/orders/new", true));
> 	      int returnCode = client.executeMethod(method);
> 

-- 
dagdag is just a two-character rotation of byebye...


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message