I have been trying to use the jigsaw client side API for making a request. Whenever I do a GET it seems to work fine but does not work for POST. Any suggestions would be helpful. Thanks, M Chandramouli Here is the code I used. request = manager.createRequest(); request.setMethod(data.getMethod()); request.setURL(u); request.setUserAgent("Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)"); if(data.getMethod().equals("POST")){ System.out.println("Setting method to post"); try { request.setContentType(MimeType.APPLICATION_X_WWW_FORM_URLENCODED); } catch(Exception e) { System.out.println("Error in setting content type"); e.printStackTrace(); }; String body = java.net.URLEncoder.encode(data.getArgString()); request.setOutputStream(new StringBufferInputStream(body)); } Reply reply = null; try { reply = manager.runRequest(request); } catch (Exception e) { e.printStackTrace(); };Received on Friday, 10 December 1999 15:20:21 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT