Yes, evidently.
But, its doesn't work.
My code :

DefaultHttpClient httpclient = new DefaultHttpClient();
        HttpHost targetHost = new HttpHost(My_URL);
        HttpRequest req = new BasicHttpRequest("GET", "/",
HttpVersion.HTTP_1_1);

        HttpResponse response=null;

        //uses proxy.
        //without, no connection
        HttpHost proxy = new HttpHost(proxy,3128);
        httpclient.getParams().setParameter
            (ConnRoutePNames.DEFAULT_PROXY, proxy);

        //send request
        response = httpclient.execute(targetHost, req);

        HttpEntity entity=response.getEntity();
        //finish??
        if (entity != null)
                                entity.consumeContent();
                return response;

I'd like to have a 401 error, because i want a page which need
authenticate.
But the response gives me a HTTP 200 ok

That's strange, and i' really don't know why :/

If you have some idea or clue...

Thanks

On 8 oct, 19:43, Mark Murphy <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > hey everybody.
>
> > I'd like tu do aHttpconnectionto a server with this lib :
> > org.apache.http.*;
>
> > But, that's very difficult to me. i'm lost in all the interface &
> > class.
>
> > So, if someone can describe me the different programming step or give
> > me some tuto or example (source), that will be nice.
>
> http://hc.apache.org/httpcomponents-client/examples.html
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
>
> Android Training on the Ranch! -- Mar 16-20, 
> 2009http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to