omsivan1 has asked for the wisdom of the Perl Monks concerning the following question:
if (open(fin,$filename)) { while (<fin>) { $body = "$body$_"; } close ($fin); my $blength = length($body); my $hblength = length($header) + $blength; my $header = "Version: 0.2 Username: $username Password: $password Organization: $organization Message Type: ANSI Usage: TEST Body Length: $blength Header Plus Body Length: $hblength "; $ua = LWP::UserAgent->new; $res = $ua->request(POST 'https://secure.inusasoft.com/stomp/servl +et/com.inusasoft.transport.adapters.inbound.http.HttpAdapter', Content_Type => 'multipart/form-data; boundary="ifyoucanse +ethisyourstuffisbroke"', Content => [ "$header$body" ]); open (fh, ">> $logfilepath/$now.txt"); print fh " $now $tnow----------------------------------------------------------- "; print fh $res->content; # Uncomment to display data sent to standard out print "$header$body"; # Uncomment to display data received to standard out print $res->content; close (fh); } else { open (fh, ">> $logfilepath/$now.txt"); print fh " $now $tnow---------------------------------------------------------- "; print fh "Cannot Open file: $filename"; print "Cannot Open $filename"; close fh }
janitored by ybiC: Balanced <code> tags around codeblock
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with https post
by iburrell (Chaplain) on Mar 23, 2004 at 01:09 UTC | |
|
Re: Help with https post
by Vautrin (Hermit) on Mar 22, 2004 at 22:37 UTC |