commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Chow" <ec...@macaucabletv.com>
Subject HttpClient no response
Date Thu, 22 May 2003 04:21:09 GMT
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!
==========================


Mime
View raw message