473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

another 'POST from perl' question

JD
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

Jul 19 '05 #1
0 2877

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John Smith | last post by:
Hello, I have a rather odd question. My company is an all java/oracle shop. We do everything is Java... no matter what it is... parsing of text files, messaging, gui you name it. My question...
1
by: Wet Basement | last post by:
I am passing data to a putcart.pl , parsing it, then building the query string to put the item in the shopping cart: $cartStr =...
1
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING...
5
by: Bob MacBob | last post by:
Hi all, I have two scripts: 1/ parser.pl which parses a text file and stuffs the relevant data into a mySQL DB - works fine no probs there 2/ importer.pl which I want to run through all the...
26
by: Materialised | last post by:
Hi everyone, I seen the post by Rob Morris, and thought that I would double check that I was using pointers in the correct way. So I written the following string functions to test. I know soem can...
8
by: shandra | last post by:
I have a file I need to delete or truncate. I tried using the KILL command in VB6. I tried using the file.delete command in VB.net. I tried manually deleting, renaming, and copying over the...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
20
by: metaperl | last post by:
I was shocked to see the personal insults hurled in this thread: http://groups.google.com/group/comp.lang.python/browse_thread/thread/d0758cb9545cad4b I have been very pleased with Python...
1
by: pragatid | last post by:
Hi, I am new to Perl programming. Let me explain my requirement over here. I have a Perl script located in /usr/sbin/ say script A and I want to invoke this script via web after accepting some user...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.