When I use the following code I get a weird problem. Somehow the server that I poat to gets some junk values appended at the end of this value that send them. Hence they are not able to process it. If anyone can throw some light on this issue I will extremely grateful. Thanks in advance, Om The snippet is as follows:
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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.