Hello Monks. I apologize to ask such simple question for you.

I have the following script section:

$response = $session->post('http://92.0.7.11/reports/GenerateReports.d +o?reportID=91', Content => [vmReportType=>'', deviceId=>'', perVM=>'', category=>'0', bview=>'All', showType=>'1', top=>'10', time=>'custom', timeWindow=>'0-24', startTime=>'2013-04-21', startHour=>'19', endTime=>'2013-04-22', endHour=>'7', show=>'Show+Report']);

The problem is with the line 'show=>'Show+Report'. I made a packet capture using Wireshark, when I make a request from a webpage. In the packet capture I see the line 'Show+Report', as the parameter for the 'show' variable. However, when I simulate the request using the LWP::UserAgent module, and with the code above, I see the line changed: 'Show%2BReport'.

I want to send the '+' sign as is. I tried escaping with URI::Escape, but doesn't work

my $plus = '%2B'; show=>'Show'.uri_escape($plus).'Report'

OR:

my $plus = '+'; show=>'Show'.uri_escape($plus).'Report'

I tried with the uri_unescape function either with no luck

The change above gives me more hexadecimal characters

How do I escape the plus sign, inside a Post request using LWP::UserAgent?

Thanks for any help!


In reply to Can't get '+' character to appear in a POST request. by oldwarrior32

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.