Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How To Post From A Script

Posted on 2004-03-23
1
Medium Priority
?
175 Views
Last Modified: 2013-12-25
I need to post some XML to an external web address (Java servlet on another web server) from within a shopping cart written in perl. I need example code for how to do this. I also need to know if it can be done to an SSL address.
0
Comment
Question by:jimkat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
AsbjornG earned 2000 total points
ID: 10665794
Hi Jimkat,

Try like this:

use LWP::UserAgent;
$ua = new LWP::UserAgent;
$req = new HTTP::Request 'POST','https://www.webserver.com/script.pl';
$req->content_type('application/x-www-form-urlencoded');
$req->content("variable1=value1&variable2=value2&variable3=value3");
$res = $ua->request($req);

the $res variable will contain the result of your post.

You will of course need to have the LWP module installed, and  Crypt::SSLeay or
IO::Socket::SSL will be necessary to communicate through SSL.


Hope this helps.

Asbjorn
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you using email marketing software? If not, you're missing out on effortless marketing and the reaching of desired conversion rates through email marketing software.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question