How to HTTPS with authentication and extra properties?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • carl

    How to HTTPS with authentication and extra properties?

    The following PERL code snipet request
    (automated client request, OR, it can be JUST A PLAIN BROWSER REQUEST)
    needs to be converted to Java2-1.3:

    $urlreq="https://myname:mypaswd@ www.farm.com/apps/animalsX?DOG=bo xer&COLOR=brown "
    $ua->agent("Mozil la/3.0");
    my $request = new HTTPS::Request( 'GET', $urlreq);
    $request->content_type(' application/x-www-form-urlencoded');
    ..
    .. (collect data and save it).
    ..

    Anyone have a snipet sample, in Java, of how I do this?

    HTTPS seems makes things a bit more complicated in Java.

    Is there just as easy a way in a Java client
    (by putting name/passwd and property data in with URL) or
    how would I submit the URL connection by creating individual
    properties?

    A bit lost and cornfused . . .


    TIA,
    Carl



  • Carl

    #2
    Re: How to HTTPS with authentication and extra properties?

    Will pay $$$ for help. Anyone?


    Carl
    --------------------------------------------------------------------------------------------

    On Thu, 09 Oct 2003 11:58:54 -0500, carl <cherme@swbell. net> wrote:
    [color=blue]
    >The following PERL code snipet request
    >(automated client request, OR, it can be JUST A PLAIN BROWSER REQUEST)
    >needs to be converted to Java2-1.3:
    >
    >$urlreq="https ://myname:mypaswd@ www.farm.com/apps/animalsX?DOG=bo xer&COLOR=brown "
    >$ua->agent("Mozil la/3.0");
    >my $request = new HTTPS::Request( 'GET', $urlreq);
    >$request->content_type(' application/x-www-form-urlencoded');
    >.
    >. (collect data and save it).
    >.
    >
    >Anyone have a snipet sample, in Java, of how I do this?
    >
    >HTTPS seems makes things a bit more complicated in Java.
    >
    >Is there just as easy a way in a Java client
    >(by putting name/passwd and property data in with URL) or
    >how would I submit the URL connection by creating individual
    >properties?
    >
    >A bit lost and cornfused . . .
    >
    >
    >TIA,
    >Carl
    >
    >[/color]


    Comment

    • Chris

      #3
      Re: How to HTTPS with authentication and extra properties?

      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      carl wrote:
      [color=blue]
      > Anyone have a snipet sample, in Java, of how I do this?
      >
      > HTTPS seems makes things a bit more complicated in Java.
      >
      > Is there just as easy a way in a Java client
      > (by putting name/passwd and property data in with URL) or
      > how would I submit the URL connection by creating individual
      > properties?
      >
      > A bit lost and cornfused . . .
      >
      >
      > TIA,
      > Carl[/color]

      Hi,
      I don't actually have code to do this, but I would create a
      java.net.URL object for the URL (without username/password). I would
      then use the openConnection( ) method, which should return an instance
      of javax.net.Https URLConnection in this case. I would use
      setRequestPrope rty(), which is inherited from
      java.net.HttpUR LConnection(), to set the appropriate header fields
      (username and password would be part of this, you'd have to look up
      the specs for exactly HOW to do it). Finally, call connect() and
      getInputStream( ), and do whatever you need.

      - --
      Chris
      -----BEGIN PGP SIGNATURE-----
      Version: GnuPG v1.2.2 (GNU/Linux)

      iD8DBQE/kDHVwxczzJRavJY RAglwAJ0WgFcRt8 Q7A2B5W1w8d4cnu TUuyACeKxaN
      ZBFZZK4KCoVpBm2 5D3Hj+rw=
      =OUFF
      -----END PGP SIGNATURE-----

      Comment

      Working...