Humm....
I'me trying to get a responce from an NT box offering me a ASP based
forms system,
I've used LWP and HTTP::Request etc. in the past to do this from CGI based pages,
perhapes there is knowlage with the greater monks on why this code will not give a correct responce.
The submission works , the form server genorates a answer that indicated I've submitted a blank form.
1. The form is asking for a POST method , However unless I send the request with URL encoded data I get no responce.
2. when I do send a request in a correct POST format, The form data is lost.
my $forms_agent = LWP::UserAgent->new();
$forms_agent->from('nolan@foo.bar');
$forms_agent->timeout(62);
my $cjar = HTTP::Cookies->new();
my $content = "SNumber=$_[0]\nDataAction=Submit";
my $saf_url = URI::URL->new();
$saf_url->base("http://192.168.1.1/safety/");
$saf_url->path("UpdateAction.asp");
$saf_url->query("DataAction=Submit&SNumber=$_[0]");
my $head = HTTP::Headers->new( Accept=>'text/html' );
$head->referer('UpdateForm.asp');
$head->date(time);
my $saf_request = HTTP::Request->new(POST=>$saf_url,$head,$con
+tent);
my $answer = $forms_agent->request($saf_request);
$cjar->extract_cookies($answer);
$saf_url->path($answer->header("location"));
$saf_url->query('');
$saf_request = HTTP::Request->new( POST=>$saf_url,$head);
$cjar->add_cookie_header($saf_request);
$answer = $forms_agent->request($saf_request);
Is there An Error in my code ??
Or Is this more likely an error in the servers ASP system.??
Thanks much ,
Bill Nolan
wnolan@bnl.gov
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.