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
In reply to Help with https post by omsivan1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |