Hello teo,

> I am new to httpclient project, and I am trying to post some data to
> my account on the web using httpclient and PostMethod. But, the web
> site is protected by firewall, and I can not post my data..

I doubt you have a firewall issue. If a firewall intercepts your connection,
you'll get "Connection refused" errors. Authentication won't help then.

> I am not sure what kind of firewall they are using, and I tried to
> set basic authorization settings as follow:

You should use a browser to access the page and monitor the requests
that are sent there. The try to re-create the same sequence using
HttpClient. Sending a single PostRequest is almost sure to fail. Most
servers require a session to be established first. So you have to perform
a GET on the site to obtain a session cookie and send a POST afterwards
for login. Once you have established a session and authenticated, you
can try to post data to your account.

hope that helps,
  Roland

> client.getState().setCredentials(new 
> AuthScope(AuthScope.ANY_HOST,AuthScope.ANY_PORT,AuthScope.ANY_REALM), 
> //"www.verisign.com", 443, "realm"),
>                     new UsernamePasswordCredentials("username", "password")
>                 );
>             HttpClientParams hhcp = new HttpClientParams(); 
>             hhcp.setAuthenticationPreemptive(true);
>             client.setParams(hhcp);
>             //client.getState().setAuthenticationPreemptive(true);
>             get.setDoAuthentication(true);
> 
> 
> I really do appreciate any help..
> 
> 
> Thank you..
> 
> --teo
> 
> 
> 
>               
> ---------------------------------
> Bring words and photos together (easily) with
>  PhotoMail  - it's free and works with Yahoo! Mail.


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

Reply via email to