hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: How to "mimic a browser" for threaded web sites?
Date Fri, 06 Jul 2007 19:21:17 GMT
Hi Jerry,

> I thought the "name"  and the "value" 
> had to be String constants compiled with the source  code.  Are you saying 
> that the "value" can be a variable containing a  String constant that it picks 
> up at run time, so that the "cutting" and  "preparing of the POST request" can 
> be dynamic, using JAVA methods?

Yes, exactly. You have to pass String objects, but
nowhere it is said that those have to be constants
compiled into the source code:

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/PostMethod.html#addParameters(org.apache.commons.httpclient.NameValuePair[])

PostMethod   post = new PostMethod(uri);
NameValuePair nvp = new NameValuePair
   ("random", String.valueOf(Math.random()));
post.addParameter(nvp);


hope that helps,
  Roland

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


Mime
View raw message