hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Oliver" <ol...@appsaspeers.com>
Subject RE: Tutorial or examples or archive
Date Fri, 13 Dec 2002 16:45:44 GMT
HostConfiguration?  What package is that in?

Michael Oliver
AppsAsPeers LLC
7391 S. Bullrider Ave.
Tucson, AZ 85747
Phone:(520)574-1150
Fax:(520)844-1036


-----Original Message-----
From: Chang Sau Sheong [mailto:cssheong@pacific.net.sg] 
Sent: Friday, December 13, 2002 9:09 AM
To: Commons HttpClient Project
Subject: Re: Tutorial or examples or archive

I'm planning to write a short tutorial for HttpClient sometime during
the
Christmas break (hopefully that's before the alpha2 release). In the
meantime, check out the sample JUnit code in the codebase. This is a
simple
snippet of how I use HttpClient myself:

<snippet>

  InputStream is = null;

    try {
      // 1. create httpclient object
      HttpClient client = new HttpClient();

      // 2. create config object
      HostConfiguration config = new HostConfiguration();

      // 3. set the configuration
      config.setHost(url, port, protocol);

      // 4. apply the configuration
      client.setHostConfiguration(config);

      // 5. create a post method
      UrlPostMethod post = new UrlPostMethod(url + page);

      // 6. set the query parameters you want to post to the page
      post.addParameter(key, value);

      // 7. execute the method through the client object
      client.executeMethod(post);

      // 8. get back the response as an input stream
      is = post.getResponseBodyAsStream();

    }
    catch (Exception e) {}

    // ... process your input stream

</snippet>

Hope it helps.


.sausheong
elipva Ltd

----- Original Message -----
From: "Mike Oliver" <ollie@appsaspeers.com>
To: "'Commons HttpClient Project'"
<commons-httpclient-dev@jakarta.apache.org>
Sent: Friday, December 13, 2002 11:53 PM
Subject: RE: Tutorial or examples or archive


> Or an archive of this list....;-)
>
> Michael Oliver
> AppsAsPeers LLC
> 7391 S. Bullrider Ave.
> Tucson, AZ 85747
> Phone:(520)574-1150
> Fax:(520)844-1036
>
>
> -----Original Message-----
> From: Thandra, Kiran [mailto:Extern.Kiran.Thandra@vw.com]
> Sent: Friday, December 13, 2002 8:51 AM
> To: 'Commons HttpClient Project'
> Subject: RE: Tutorial or examples
>
> It would help me too.
>
> Thanks,
> Thandra
>
> -----Original Message-----
> From: Mike Oliver [mailto:ollie@appsaspeers.com]
> Sent: Friday, December 13, 2002 10:35 AM
> To: commons-httpclient-dev@jakarta.apache.org
> Subject: Tutorial or examples
>
>
> I have been searching for either a tutorial or examples of the use of
> commons-httpclient but have not had good success, any help would be
> appreciated.
>
>
>
> Michael Oliver
> Chief Technology Officer
> AppsAsPeers LLC
> 7391 S. Bullrider Ave.
> Tucson, AZ 85747
> 520.574.1150 Voice
> 520.844.1036 Fax
> 520.270.8862 Cell
> http://www.appsaspeers.com <http://www.appsaspeers.com/>  Home Page
> 5202708862@voicestream.net SMS
> http://www.ollie.ezpeer.net <http://www.ollie.ezpeer.net/>  Personal
> Home Page
> http://www.ollie.im-live.com/im-live/  Instant Chat
> MikeOliverAZ@hotmail.com MSN Messenger
> MikeOliverAZ@yahoo.com Yahoo Instant Messenger
> MikeOliverAZ Aol Instant Messenger
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-httpclient-dev-help@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-httpclient-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:
<mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-httpclient-dev-help@jakarta.apache.org>



Mime
View raw message