FileDocCategorySizeDatePackage
GetExample.javaAPI DocExample1689Wed May 18 09:39:00 BST 2005com.discursive.jccook.httpclient

GetExample

public class GetExample extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		HttpClient client = new HttpClient();
		String url = "http://www.discursive.com/jccook/";
		HttpMethod method = new GetMethod( url );
	
		try {
			client.executeMethod( method );
			String response = method.getResponseBodyAsString();

			System.out.println( response );
		} catch( HttpException he ) {
			System.out.println( "HTTP Problem: " + he.getMessage() );
		} catch( IOException ioe ) {
			System.out.println( "IO Exeception: " + ioe.getMessage() );
		} finally {
			method.releaseConnection();
			method.recycle();
		}