develooper Front page | perl.libwww | Postings from January 2001

Posting files to a secure site

Thread Next
January 17, 2001 13:56
Posting files to a secure site
Message ID:
I need to post text files to a secure web site.  All the information I have
is the following:

URL (https://some URL)
the username
the password

I have been messing around with the following sample code that I found...
but it doesn't seem to be fulfilling my needs since I don't know of any cgi
script on the server side.  Is there information I am missing that is
necessary for me to post text files to this site?  Can anyone point me to
sample code that will help me?

use LWP::Simple;
use URI::URL;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
$ua = LWP::UserAgent->new(); #create a user agent
#post the message to the server
#this will activate the program that needs to run
#in this program, will run on the server side
$streamstring = "string to be passed to the server";
my  $req = POST '',[Filecontents =>$streamstring];
#content is what the server sends back after processing
$content = $ua->request($req)->as_string;
print $content;

Sammy Davis

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About