develooper Front page | perl.libwww | Postings from January 2001

Request Post error line 227

Thread Next
John Gerrish
January 24, 2001 14:11
Request Post error line 227
Message ID:
I am (occasionally) receiving this error:
[23/Jan/2001:15:57:47] failure (10907): for host
 158.###.###.117 trying to POST /cgi-bin/test/paycc.cgi,
 cgieng_scan_headers reports: the CGI program
 /usr/netscape/server4/cgi-bin/test/paycc.cgi did not
 produce a valid header (name without value: got line
 "can't call method "request" on an undefined value at
 line 227.")

in my httpd log when performing:

   use HTTP::Request::Common qw(POST);
   use LWP::UserAgent;
   $ua = LWP::UserAgent->new;

   my $req = POST "https:\/\/$cc_gateway_host$script",
   [   'x_Login'           => $cc_merchantID
      ,'x_Test_Request'    => $cc_test_mode
      ,'x_Description'     => $pay_xact_desc
   $response = $ua->request($req)->as_string;

To call a credit card processor within the CGI script for
my web pages.  It works ok 80% of the time.

The really strange thing is that the CC processor does react 
to my request (the transaction is processed perfectly)
but the error kills my CGI so user sees an incomplete page.

Does anyone have any insight into this problem?  Could some
error trap on my "$response = $ua->request($req)->as_string;"
statement allow me to recover from the error?  
Or could I copy into my directory and attempt to 
debug it?

# $Id:,v 1.73 2000/04/07 11:29:04 gisle Exp $
# $Id:,v 1.27 1999/11/17 20:38:14 gisle Exp $
# $Id:,v 1.16 1999/10/28 11:49:02 gisle Exp $

bash-2.03$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0)
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos chaos 5.8 generic_108528-02 sun4u sparc
sunw,ultra-5_10 '
    cc='cc', optimize='-O', gccversion=2.95.2 19991024 (release)
Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under solaris
  Compiled at Nov  7 2000 11:33:38

-- tia
John Gerrish     RMS3 Application Manager     907-465-8861    fax:2024
                 Alaska Marine Highway System, DOT/PF, State of Alaska
                 3132 Channel Dr, Juneau, AK  99801
Blessed are the flexible for they shall not be bent out of shape.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About