cURL / Mailing Lists / curl-users / Single Mail


Curl In JSP

From: Lenny Sorey <>
Date: Wed, 25 Feb 2004 14:53:40 -0600

Good day all,

I am using Curl.exe from a command line in order to post information via HTTP.

I want to use Curl in a JSP which is a requirement of my customer.

I have placed the curl.exe in my jsp directory from which I'm launching my jsp which contains
the Runtime.getRuntime().

I can run Curl with success from a command line with the parameters show below and get the desired results.

When I try to use the same command line within my jsp as shown below, I get a blank page.

Any guidance here would certainly be appreciated.

Thanks in advance.

Lenny Sorey

Platform is as follows:

Win 2K server
J2SDK 1.4.2
Tomcat 4.1.29


Runtime r = Runtime.getRuntime();
String mycurl = "curl.exe -e -v "

Process p = r.exec(mycurl);

InputStream is = p.getInputStream();
StringBuffer buf=new StringBuffer();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
int readByte = -1;
while ((readByte = > -1) {

mybuf = buf.toString();


}catch(Exception e){

Received on 2004-02-25