I need to send XML formated information to the API.
So there's money involved, hmmm? That's going to make it interesting. It's a simple problem, in theory; I concur with others that using LWP is going to be a big win over calling cURL; it may seem simpler at the beginning, but the potential for a muck-up is higher. I suspect they use cURL as an example because you'll find it on most platforms, and the concepts are universal to any HTTP client/server setup.
I see someone has given an example already, go you! So I'm deleting mine, but also pointing you to the LWP Cookbook for examples, and I'll keep this "assumptions to watch for" bit, which include:
In short -- this is a good bit of work. And that's before the security stuff...
if security is a big concern with cURL then I should focus more time on installing the other module.
It's not cURL that's the security problem, per se. Any data you pick up from a user and do anything with can be a problem down the road. One example is our old friend SQL Injection, another is someone sending backticked data to a program on the command line. "Backtick", FYI, is one of the ways you can call a program via Perl with something like `/usr/bin/curl http://www.payment_center.com`.
But it is so not recommended. If a bad person tries hard enough, they can likely break your system with the right code, since you're sending text to the command line under your login. Beyond that, checking for errors is tough, and you need to do that, otherwise how do you tell people if their payment goes through, or figure out if the payment center's system is up or down? It's not impossible...but it's much easier in LWP, overall.
Does any of this help? What might also be of aid is to read up on CGI and Perl; Ovid's CGI Course is a good place to start.
----Asim, known to some as Woodrow.
In reply to Re^3: Using CURL
by Asim
in thread Using CURL
by peewee_zz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |