- From: eboodle <cmouli@eboodle.com>
- Date: Fri, 10 Dec 1999 12:24:12 -0800
- To: <www-jigsaw@w3.org>
- Message-ID: <009d01bf434c$85c79bd0$1701010a@eboodle.com>
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