LWP::Request technical question?

Discussion in 'Perl Misc' started by at, Jan 20, 2004.

  1. at

    at Guest

    Perlites:

    I have a perl program that uses LWP to access an https site. It was
    working but a few weeks ago stopped. The remote server is complaining
    that my request format is incorrect.

    My code section looks like this:

    $REQ= POST 'https://www.blah.com',
    [ NETCONNECT_TRANSACTION => $DATA ];
    $REQ->authorization_basic($USERID,$PASSWD);

    $RSP=$UA->request($REQ);

    When I print the $REQ as_string it shows the following:

    POST https://www.blah.com/netconnect2_0Demo/servlets/NetConnectServlet
    Authorization: Basic ZmluZGUGF0Y286SjVsMjEwbW4XYZO=
    Content-Length: 2496
    Content-Type: application/x-www-form-urlencoded

    NETCONNECT_TRANSACTION=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8
    %22%3F%3E%3CNetConnectRequest+xmlns%3D%22http%3A%2F%2Fwww.blah.com%2FNetConnect%22xmlns%3A
    .... etc ...


    The webmaster at the remote server is stating that the reason for the
    failure is that I DO NOT HAVE an '&' preceeding the
    "NETCONNECT_TRANSACTION=" in my request.

    So, my question is:

    If the request is a POST then is the Ampersand required or automatic?

    If it does belong there then what can be done to assure that the
    request format is correct (i.e.: proper url_encoding)?

    Please advise anyone???

    Thanks

    B
    at, Jan 20, 2004
    #1
    1. Advertising

  2. at

    gnari Guest

    <R.Mariotti (at) FinancialDataCorp.com (Bob Mariotti)> wrote in message
    news:...
    > Perlites:
    >
    > I have a perl program that uses LWP to access an https site. It was
    > working but a few weeks ago stopped. The remote server is complaining
    > that my request format is incorrect.
    >
    > My code section looks like this:
    >
    > $REQ= POST 'https://www.blah.com',
    > [ NETCONNECT_TRANSACTION => $DATA ];
    > $REQ->authorization_basic($USERID,$PASSWD);
    >
    > $RSP=$UA->request($REQ);
    >
    > When I print the $REQ as_string it shows the following:
    >
    > POST https://www.blah.com/netconnect2_0Demo/servlets/NetConnectServlet
    > Authorization: Basic ZmluZGUGF0Y286SjVsMjEwbW4XYZO=
    > Content-Length: 2496
    > Content-Type: application/x-www-form-urlencoded
    >
    > NETCONNECT_TRANSACTION=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8
    >

    %22%3F%3E%3CNetConnectRequest+xmlns%3D%22http%3A%2F%2Fwww.blah.com%2FNetConn
    ect%22xmlns%3A
    > ... etc ...
    >
    >
    > The webmaster at the remote server is stating that the reason for the
    > failure is that I DO NOT HAVE an '&' preceeding the
    > "NETCONNECT_TRANSACTION=" in my request.


    this is nonsense.

    what is the exact error message you get.
    maybe the error is in the XML you are posting.

    gnari
    gnari, Jan 20, 2004
    #2
    1. Advertising

  3. "gnari" <> writes:

    > <R.Mariotti (at) FinancialDataCorp.com (Bob Mariotti)> wrote in message
    > news:...
    > > I have a perl program that uses LWP to access an https site. It was
    > > working but a few weeks ago stopped. The remote server is complaining
    > > that my request format is incorrect.


    > > POST https://www.blah.com/netconnect2_0Demo/servlets/NetConnectServlet
    > > Authorization: Basic ZmluZGUGF0Y286SjVsMjEwbW4XYZO=
    > > Content-Length: 2496
    > > Content-Type: application/x-www-form-urlencoded
    > >
    > > NETCONNECT_TRANSACTION=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8
    > >

    > %22%3F%3E%3CNetConnectRequest+xmlns%3D%22http%3A%2F%2Fwww.blah.com%2FNetConn
    > ect%22xmlns%3A
    > > ... etc ...
    > >
    > >
    > > The webmaster at the remote server is stating that the reason for the
    > > failure is that I DO NOT HAVE an '&' preceeding the
    > > "NETCONNECT_TRANSACTION=" in my request.

    >
    > this is nonsense.


    If the webmaster is admitting that there's a bug in his server I would
    not be inclined to dismiss it as "nonsense" without some futher
    evidence.

    --
    \\ ( )
    . _\\__[oo
    .__/ \\ /\@
    . l___\\
    # ll l\\
    ###LL LL\\
    Brian McCauley, Jan 20, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vinay Gupta
    Replies:
    2
    Views:
    1,096
    Michael Schlenker
    Jul 27, 2004
  2. demonhunter
    Replies:
    3
    Views:
    2,099
  3. Chris
    Replies:
    1
    Views:
    97
    Mina Naguib
    Jul 7, 2003
  4. Kevin Su

    LWP::Request

    Kevin Su, Jul 28, 2003, in forum: Perl Misc
    Replies:
    6
    Views:
    82
    Vlad Tepes
    Aug 2, 2003
  5. jarkun
    Replies:
    1
    Views:
    106
    Charles DeRykus
    Sep 5, 2003
Loading...

Share This Page