Client side API Post

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 UTC