Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Problem Using POST

by grep (Monsignor)
on Feb 02, 2008 at 01:00 UTC ( #665688=note: print w/ replies, xml ) Need Help??

in reply to Problem Using POST

The form you want to post to is found in the <form> tag: prep_job.php

So you want to change your request to something like.

my $response = $browser->post( '', [ "upload"=> ["C:\\protean\\1o1l\\1o1l.pdb"], "jobname"=> "PRT1", "case" => "2", "email" => "email\", "optin" => "true", "upload2"=> ["C:\\protean\\1o1l\\1o1l.pdb"], ], 'Content_Type' => 'form-data', );
One dead unjugged rabbit fish later...

Comment on Re: Problem Using POST
Select or Download Code
Replies are listed 'Best First'.
Re^2: Problem Using POST
by Joost (Canon) on Feb 02, 2008 at 01:19 UTC
Re^2: Problem Using POST
by Anonymous Monk on Feb 02, 2008 at 14:13 UTC
    When I do it like the way you say, it says no pdb is supplied (which is that upload input type). Is there something I am doing wrong there? (I will also look at mechanize)
Re^2: Problem Using POST
by Anonymous Monk on Feb 02, 2008 at 18:47 UTC
    I also tried this to no use. It still returns "no pdb(the file) uploaded" error.
    #!/usr/bin/perl -w # - query California license plate database use strict; use LWP::UserAgent; use HTTP::Request::Common; use HTTP::Headers; my $browser = LWP::UserAgent->new; my $request = HTTP::Request->new(); my $url=""; my $file="C:/protean/1o1l/1O1L.pdb"; my $response = $browser->request( POST $url, 'Content_Type' => 'form-data', Content=>[ "upload"=> [$file], "jobname"=> "PRT1", "case" => "2", "email" => "sinatureli\", "optin" => "true", "upload2"=> [$file], ], ); die "Error: ", $response->status_line unless $response->is_success; print $response->content; exit;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://665688]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2015-11-27 04:05 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (717 votes), past polls