Oops. Yes, I'm using HttpClient from the HEAD branch. If you take out the references to HttpMethodParams and add the following for each method, it should work:

method.setRequestHeader("user-agent", "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1");

You can also change the user agent to something else if you like.

Mike

On Apr 29, 2004, at 9:54 AM, Min (Frank) Ni wrote:

Hi Mike:

Thank you for your sample code, I tried to compile it, but got the following errors :

======================================================================= ========================================
YahooLogin.java [13:1] package org.apache.commons.httpclient.params does not exist
import org.apache.commons.httpclient.params.HttpMethodParams;
^
YahooLogin.java [28:1] cannot find symbol
symbol : variable HttpMethodParams
location: class YahooLogin
client.getParams().setParameter(HttpMethodParams.USER_AGENT, "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1");
^
YahooLogin.java [28:1] cannot find symbol
symbol : method getParams()
location: class org.apache.commons.httpclient.HttpClient
client.getParams().setParameter(HttpMethodParams.USER_AGENT, "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/124 (KHTML, like Gecko) Safari/125.1");
^
3 errors
Errors compiling YahooLogin.
======================================================================= ========================================


I have mounted "commons-httpclient-2.0.jar" and "commons-logging.jar" on to my project in NetBeans, Have I missed anything else that has "package org.apache.commons.httpclient.params" ?

Frank

-----Original Message-----
From: Michael Becke [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 29, 2004 12:35 AM
To: Commons HttpClient Project
Subject: Re: Yahoo login with Httpclient


Well, I've tried a variety of things, but I cannot successfully login to yahoo. Attached is the code that I've been using. It includes two methods, one to simulate logging in from a browser with JavaScript turned off, and another to simulate with JS on. Perhaps someone else can figure it out from here.

Mike


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




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



Reply via email to