hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dasKlei...@gmx.net
Subject looking for the request OutputStream
Date Wed, 01 Nov 2006 11:22:22 GMT

I am new in network programming.

The following example shows, how I handle the inputstream
with HttpClient.


        client = new HttpClient();

        GetMethod  method = new GetMethod(SERVERURL);
        try {
            int statusCode = client.executeMethod(method);

//          ...  exception handling

            // I am looking for the opposite
            InputStream in = method.getResponseBodyAsStream();
            DataInputStream dataIn = new DataInputStream(in);
            String test = dataIn.readUTF();
             // make a flush ...
             // close and handle the response


I am looking for the opposite.

How can the client make an outpustream and send data to
the server ?

The data I want to transport are some :

    'Strings' to control the workflow and
    'files'   (context-type : application/octet-stream)

I found nothing about OutpuStreams, only something like :

    method.setQueryString(NameValuePair[] arg0);

Probably I am on the wrong way,

thanks for help,

GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message