another 'POST from perl' question

Discussion in 'Perl' started by JD, Jan 14, 2005.

  1. JD

    JD Guest

    Hi,
    I've searched for several weeks, and I've found code that should allow
    me to post from my perl script. I continue to fail, though.
    Admittedly, I am not good with OOP (other than VB). I'm trying to post
    so as to process credit card info, and authorize.net states that I must
    POST with a query string (?), but don't use GET. In short, I've tried:
    use CGI; use LWP::UserAgent; use HTTP::Request;
    use HTTP::Status; $cgi = new CGI;
    my $ua = LWP::UserAgent->new;
    my $submit_str = "x_login=$acct_id&x_tran_key=$tran_key";
    my $request = new HTTP::Request 'POST', $transaction_server;
    $request->content_type('application/x-www-form-urlencoded');
    $request->content($submit_str);
    my $response = $ua->request($request);
    $resp = $response->content;
    if ($response->is_success) { print "Success"; }
    else { print "Fail"; }

    and I've tried a combination of variations:
    my $response = $ua->request(POST $transaction_server,
    ['x_login' => $acct_id, 'x_tran_key' => $tran_key],);

    including passing my data as a query_string, but I just can't make it to
    is_success. I also can't decipher the hash that LWP appears to return.

    I've looked at cpan, perl.com, and my cookbook, but to no avail. Tech
    support doesn't support scripts, so they're little help.

    Any suggestions or help? I apologize for my ignorance.
    Thank you,
    -jd
     
    JD, Jan 14, 2005
    #1
    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. Wet Basement
    Replies:
    1
    Views:
    2,536
    BobMonk
    Jul 15, 2003
  2. =?Utf-8?B?T2xlZw==?=

    Server.Redirect to post to another page question

    =?Utf-8?B?T2xlZw==?=, Aug 26, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,309
    John Rivers
    Aug 26, 2005
  3. \(ProteanThread\)
    Replies:
    1
    Views:
    352
    Walter Roberson
    Mar 10, 2005
  4. Petterson Mikael

    Execute another perl script from my perl script

    Petterson Mikael, Jan 5, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    142
    Paul Lalli
    Jan 5, 2005
  5. JD
    Replies:
    3
    Views:
    101
    Sherm Pendley
    Jan 14, 2005
Loading...

Share This Page