Hello Puneet,

> I am really new to this api. I went through the tutorial and tried doing 
the
> very basic thing. Just getting the reponse based on a http request.
> 
> HttpClient client  = new HttpClient();
> GetMethod method = new GetMethod("www.google.com");

"www.google.com" is _not_ a URL. Use "http://www.google.com/";.
Browsers make that transformation automatically. But HttpClient
is not a browser.

> try {
> client.executeMethod(method);
> System.out.println(new String(method.getResponseBody());
> }catch(Exception e) {
> e.printStackTrace();
> }

Never write code that fails to release the connection.
NEVER. Not even in the dumbest "hello world". Just don't.

cheers,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to