You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Dan Tran <da...@gmail.com> on 2011/01/10 18:04:52 UTC
How to get httpclient to throw exception when authentication fail
Hi every one,
I am quite new to HttpClient, and have spent and couple of days try to get
HttpClient to send a http request to one my remote device. In the return,
the http response is a soap content.
However, when user/password are incorrect, i get back a faul soap response.
But What I need is an exception.
I went thru tutorial several times and could not find a obvious way to make
this happen.
Could you help? Perhaps I miss setting up a httpclient/httpget's
configuration?
Big thanks
-Dan
--
View this message in context: http://old.nabble.com/How-to-get-httpclient-to-throw-exception-when-authentication-fail-tp30635600p30635600.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to get httpclient to throw exception when authentication
fail
Posted by Dan Tran <da...@gmail.com>.
This is it!!! big thanks
-Dan
Ryan Smith-10 wrote:
>
> You could try checking the status code and throw a custom exception when
> status code = 401.
>
> hth.
>
> On Mon, Jan 10, 2011 at 12:04 PM, Dan Tran <da...@gmail.com> wrote:
>
>>
>>
>> Hi every one,
>>
>> I am quite new to HttpClient, and have spent and couple of days try to
>> get
>> HttpClient to send a http request to one my remote device. In the
>> return,
>> the http response is a soap content.
>>
>> However, when user/password are incorrect, i get back a faul soap
>> response.
>> But What I need is an exception.
>>
>> I went thru tutorial several times and could not find a obvious way to
>> make
>> this happen.
>>
>> Could you help? Perhaps I miss setting up a httpclient/httpget's
>> configuration?
>>
>> Big thanks
>>
>> -Dan
>> --
>> View this message in context:
>> http://old.nabble.com/How-to-get-httpclient-to-throw-exception-when-authentication-fail-tp30635600p30635600.html
>> Sent from the HttpClient-User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
>
>
--
View this message in context: http://old.nabble.com/How-to-get-httpclient-to-throw-exception-when-authentication-fail-tp30635600p30640409.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: How to get httpclient to throw exception when authentication fail
Posted by Ryan Smith <ry...@gmail.com>.
You could try checking the status code and throw a custom exception when
status code = 401.
hth.
On Mon, Jan 10, 2011 at 12:04 PM, Dan Tran <da...@gmail.com> wrote:
>
>
> Hi every one,
>
> I am quite new to HttpClient, and have spent and couple of days try to get
> HttpClient to send a http request to one my remote device. In the return,
> the http response is a soap content.
>
> However, when user/password are incorrect, i get back a faul soap response.
> But What I need is an exception.
>
> I went thru tutorial several times and could not find a obvious way to make
> this happen.
>
> Could you help? Perhaps I miss setting up a httpclient/httpget's
> configuration?
>
> Big thanks
>
> -Dan
> --
> View this message in context:
> http://old.nabble.com/How-to-get-httpclient-to-throw-exception-when-authentication-fail-tp30635600p30635600.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>