Re: how to postback to a different URL than the one making the request?

"Mumia W." <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
On 05/31/2007 07:49 PM, vidals wrote:
> [...]
> The postbackurl, sample.url.com is where I need to send the data and 
> I'm not sure how to do this. I thought lwp would come to the rescue 
> since I am so use to using it, but perhaps my thinking is in error and 
> LWP is not the right solution here?
> 
> 
> 

Hello vidals. I noticed the other threads you created on the same 
subject. Please try to keep your posts on a certain subject within the 
same thread you first created for that subject, and please only change 
the subject line when the subject truly changes.

LWP::UserAgent has the feature that you're looking for; did you read the 
documentation for that module?

Did you read Andy Lester's and Tim Allwine's messages?

use LWP::UserAgent;
my $url = 'http://sample.url.example.com/somescript';
my $lwp = LWP::UserAgent->new;
my $response = $lwp->post($url, { name1 => 'value1',
     name2 = 'value2' });

However, before you can be sure what to name your POST variables, you'll 
have to find out what the servers that will be receiving these requests 
require.

These are questions for you to consider when writing your program:
What is the exact URL to the script that processes the POST request?
What are the form names that are required?
What kind of POST request is expected (application/x-www-form-urlencoded 
  or multipart/form-data)?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.