Hi,
i like to simulate a login on a webpage via an httppost request. I try to
setup the parameters via the following code:
.
.
.
HttpPost httppost=new HttpPost(ggserverurl+phpexec);
HttpResponse response;
HttpEntity entity;
BufferedReader bufferedreader;
List <NameValuePair> parameters = new ArrayList
<NameValuePair>();
parameters.add(new BasicNameValuePair("a", "a"));
parameters.add(new BasicNameValuePair("b", "b"));
parameters.add(new BasicNameValuePair("c", "c"));
parameters.add(new BasicNameValuePair("d", "e"));
parameters.add(new BasicNameValuePair("e", "f"));
parameters.add(new BasicNameValuePair("f", "g"));
try {
//httppost.setParams(loginparams);
UrlEncodedFormEntity sendentity = new
UrlEncodedFormEntity(parameters,
HTTP.UTF_8);
httppost.setEntity(sendentity);
response=httpclient.execute(httppost);
entity=response.getEntity();
/**if (entity!=null){
bufferedreader=new BufferedReader(new
InputStreamReader (new
BufferedInputStream(entity.getContent())));
int i;
for(i=0;i<1000;i++)System.out.println(bufferedreader.readLine());
}**/
.
.
.
when i execute the request i am not able to see the parameter/value pairs
within an http analyzer. In the header, content-length has a value of 23. In
a tab "Post date" in the analyzing tool, i cannot see anything.
When firefox sends the request, everything is okay, the pairs are present.
Any ideas?
Greetings
Tobias
--
View this message in context:
http://www.nabble.com/HttpPost-and-parameters-tp26068695p26068695.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]