And yes, if you have a WWW::Mechanize (say $mech) object, you can then simply call:#!/usr/bin/perl use strict; use warnings; use HTTP::Request; my $host = 'what.ever.com'; my $uri = "http://$host/path/to/resource"; my $request = HTTP::Request->new(POST => $uri, [ Host => $host, 'User-Agent' => 'Mozilla whatever...', Accept => 'text/xml,application/xml,...', 'Accept-Language' => 'en-us,en;q=0.5', # you get the idea... ]); print {*STDOUT} $request->as_string(); __END__ poletti@PolettiX:~/sviluppo/perl$ perl zer.pl POST http://what.ever.com/path/to/resource Accept: text/xml,application/xml,... Accept-Language: en-us,en;q=0.5 Host: what.ever.com User-Agent: Mozilla whatever...
You have probably to work out if cookies are automatically inserted or not, and act consequently.my $response = $mech->request($request);
Hey! Up to Dec 16, 2007 I was named frodo72, take note of the change! Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Re: Communicating to AJAX
by polettix
in thread Communicating to AJAX
by zer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |