You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Eric Chow <ec...@macaucabletv.com> on 2003/05/22 06:21:09 UTC
HttpClient no response
Hello,
When I tried to post some data to a web site, it always return no response
just "null".
But if I use the same URL in browser, it showed some content in the browser.
Eric
------------------------------------
NameValuePair nv[] = new NameValuePair[35];
nv[0] = new NameValuePair("wv_booking_date", d);
nv[1] = new NameValuePair("wv_booking_place", "PAV");
nv[2] = new NameValuePair("wv_booking_time_from", "14");
nv[3] = new NameValuePair("wv_booking_time_to", "15");
nv[4] = new NameValuePair("wv_booking_light", "Y");
//nv[5] = new NameValuePair("chk_booking_light", "on");
nv[5] = new NameValuePair("wv_booking_air", "N");
//nv[7] = new NameValuePair("chk_booking_air", "on");
nv[6] = new NameValuePair("wv_booking_facilities", "xxx");
nv[7] = new NameValuePair("wv_booking_date", "");
nv[8] = new NameValuePair("wv_booking_place", "");
nv[9] = new NameValuePair("wv_booking_time_from", "");
nv[10] = new NameValuePair("wv_booking_time_to", "");
nv[11] = new NameValuePair("wv_booking_light", "");
nv[12] = new NameValuePair("wv_booking_air", "");
nv[13] = new NameValuePair("wv_booking_facilities", "");
nv[14] = new NameValuePair("wv_booking_date", "");
nv[15] = new NameValuePair("wv_booking_place", "");
nv[16] = new NameValuePair("wv_booking_time_from", "");
nv[17] = new NameValuePair("wv_booking_time_to", "");
nv[18] = new NameValuePair("wv_booking_light", "");
nv[19] = new NameValuePair("wv_booking_air", "");
nv[20] = new NameValuePair("wv_booking_facilities", "");
nv[21] = new NameValuePair("wv_booking_date", "");
nv[22] = new NameValuePair("wv_booking_place", "");
nv[23] = new NameValuePair("wv_booking_time_from", "");
nv[24] = new NameValuePair("wv_booking_time_to", "");
nv[25] = new NameValuePair("wv_booking_light", "");
nv[26] = new NameValuePair("wv_booking_air", "");
nv[27] = new NameValuePair("wv_booking_facilities", "");
nv[28] = new NameValuePair("wv_booking_date", "");
nv[29] = new NameValuePair("wv_booking_place", "");
nv[30] = new NameValuePair("wv_booking_time_from", "");
nv[31] = new NameValuePair("wv_booking_time_to", "");
nv[32] = new NameValuePair("wv_booking_light", "");
nv[33] = new NameValuePair("wv_booking_air", "");
nv[34] = new NameValuePair("wv_booking_facilities", "");
PostMethod pMethod = new PostMethod(bookAction);
pMethod.setRequestBody(nv);
client.executeMethod(pMethod);
String s = pMethod.getResponseBodyAsString();
System.out.println(pMethod.getStatusLine().toString());
System.out.println(s);
pMethod.releaseConnection();
----------------------------------
==========================
If you know what you are doing,
it is not called RESEARCH!
==========================