commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: [HttpClient][Request] Ability to debranch some logic
Date Fri, 02 Aug 2002 19:31:41 GMT
dIon,

Thanks. I am probably blind but I can't find an example of any 401 test
in the URL you provided (authentication). I can test all response codes
fine with HttpClient except 401, hence my initial email.

Here is the HttpClient code that is involved (I think) :

            if (HttpStatus.SC_UNAUTHORIZED == statusCode) {
                Header wwwauth = getResponseHeader("WWW-Authenticate");
                if (null != wwwauth) {
[some code to send another request to authenticate]

I haven't followed closely the code but I don't see any code to debranch
this. For redirects it works fine as the code is :

            } else if (HttpStatus.SC_MOVED_TEMPORARILY == statusCode ||
               HttpStatus.SC_MOVED_PERMANENTLY == statusCode ||
               HttpStatus.SC_TEMPORARY_REDIRECT == statusCode) {
                if (getFollowRedirects()) {
[...]

thus getFollowRedirects() returns false is HttpClient is set not to
follow redirects.

As I don't follow all the code for authentication, can someone from
HttpClient tell me if it is possible to test a 401 response coming from
the server without HttpClient intercepting it ?

Thanks
-Vincent

> -----Original Message-----
> From: dion@multitask.com.au [mailto:dion@multitask.com.au]
> Sent: 02 August 2002 04:10
> To: Jakarta Commons Developers List
> Subject: RE: [HttpClient][Request] Ability to debranch some logic
> 
> "Vincent Massol" <vmassol@octo.com> wrote on 08/02/2002 12:36:55 AM:
> 
> > Hi dIon,
> >
> > No I haven't. Where should I look at exactly ? Are you saying that
you
> > are able to write Latka test for 401 HTTP responses ?
> 
> Should be able to.....
> 
> here's a sample....
> 
> http://cvs.apache.org/viewcvs/jakarta-
> commons/latka/src/jelly/latka.jelly?rev=1.19&content-
> type=text/vnd.viewcvs-markup
> 
> It all relies on httpclient under the covers though...........
> >
> > Thanks
> > -Vincent
> --
> dIon Gillard, Multitask Consulting
> Work:      http://www.multitask.com.au
> Developers: http://adslgateway.multitask.com.au/developers



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message