Does somebody can tell me why this code works :
HttpClient client = new HttpClient();
PostMethod post = new
PostMethod("http://127.0.0.1:8080/interactivity/servlet/VoteResultsServlet");
NameValuePair[] data = {
new NameValuePair("ID_USER","1"),
new NameValuePair("ID_INTERACTIVITY","1")
};
post.setQueryString(data);
client.executeMethod(post);
String response = new
String(post.getResponseBodyAsString().getBytes("8859_1"));
System.out.println(response);
post.releaseConnection();
}
And this one not :
HttpClient client = new HttpClient();
GetMethod post = new
GetMethod("http://127.0.0.1:8080/interactivity/servlet/VoteResultsServlet");
NameValuePair[] data = {
new NameValuePair("ID_USER","1"),
new NameValuePair("ID_INTERACTIVITY","1")
};
post.setQueryString(data);
client.executeMethod(post);
String response = new
String(post.getResponseBodyAsString().getBytes("8859_1"));
System.out.println(response);
post.releaseConnection();
}
I would like to use a POST method but only the GET one works.
Thank you.
--
Erwan BAYNAUD
Alcatel - Research & Innovation