commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilak Mitra" <tmi...@us.ibm.com>
Subject Re: HttpClient : HTTPS and PostMethod problem/bug
Date Wed, 21 Aug 2002 20:44:21 GMT

Hello,
      Do you have the source code with you for httpclient ?

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


"Ortwin Gl├╝ck" <ortwin.glueck@nose.ch> on 08/21/2002 01:23:07 PM

Please respond to commons-dev@jakarta.apache.org

To:    commons-dev@jakarta.apache.org
cc:    Tilak Mitra/Fort Lauderdale/IBM@IBMUS
Subject:    Re: HttpClient : HTTPS and PostMethod problem/bug



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