commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ortwin Gl├╝ck" <ortwin.glu...@nose.ch>
Subject Re: HttpClient : HTTPS and PostMethod problem/bug
Date Wed, 21 Aug 2002 17:23:07 GMT
I composed the POST variant of the above snippet. Although the request 
does not make any sense the response comes back correctly.



         try {
             HttpClient client = new HttpClient();
             client.startSession("www.verisign.com", 443, true);
             client.setSSLSocketFactory(null);
             PostMethod method = new 
PostMethod("/telecom/products/index.html?action=login", "C:\\temp");
               method.addParameter("usermail","<myloginname>") ;
               method.addParameter("password","<mypassword>") ;
               method.setFollowRedirects(false);
             client.executeMethod(method);
             System.out.print(method.getResponseBodyAsString());
             client.endSession();
         } catch(Exception e) {
             e.printStackTrace();
         }



Maybe your ASP page does not work correctly and hangs? Check with a 
normal web browser. Use the logging facility (escpecially the wirelog) 
of HttpClient to see what happens. If you use Log4J you can use the 
following properties:

log4j.rootCategory=ERROR, A1
log4j.category.httpclient.wire=DEBUG, A1
log4j.category.org.apache.commons.httpclient=INFO, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern = %d %-5p %c %3x - %m\n


Tilak Mitra wrote:
> Hi,
>       The Get is working absolutely fine with me for any site using HTTPS.
>       The Post is what just hangs in the executeMethod  for HTTPS urls.
>       Is this a bug or am I doing something really wrong ?
> 
>       Is there any POST code snippet which someone has (working) ?
>       That would be of so much help to me.
>       I am trying to push the client to use this nice package, but am stuck
> showing a small proof of concept.
> 
> Regards
> Tilak
> 
> Tilak Mitra
>    IT Architect
>    IBM Global Services EAD Group
>    6301 Northwest 5th Way
>    Ft Lauderdale , Fl - 33309
>    Cell: 954 263 9050
>    Home: 954 227 6669


--
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