I would prefer to get LWP->browser->post to just stop url encoding the data values since I already have a working system to communicate with PayPal. The code is basic enough you don't really need another API on top of it like the PayPal library. If its a simple header or configuration function parameter I can set in the code setting up the post call would solve all my problems and would be the easiest solution.

Here is what is happening:

My code is passing in the the cancel and return urls unencoded, and when PayPal gets them they are encoded like below which then generates invalid url errors:

TRXTYPE=S&TENDER=P&ACTION=S&PWD=2XXXXX1&USER=ilxxxer&VENDOR=ilxxxer&PARTNER=Verisign &CANCELURL=http%3A%2F%2Fwww.proposalkit.com &RETURNURL=http%3A%2F%2Fwww.proposalkit.com&AMT=42.00

The code to send the data to PayPal is:

$host = 'https://pilot-payflowpro.paypal.com'; @parm_list = ('TRXTYPE' => 'S', 'TENDER' => 'P', 'ACTION' => 'S', 'PWD' => $verisign_pwd, 'USER' => $verisign_usr, 'VENDOR' => $verisign_usr, 'PARTNER' => $verisign_prt, 'CANCELURL' => 'http://www.proposalkit.com', 'RETURNURL' => 'http://www.proposalkit.com', 'AMT' => '42.00'); @pf_headers = ('Content-Type' => 'text/namevalue'); my $browser = LWP::UserAgent->new(); if ($browser ne null) { $browser->timeout(90); $browser->agent('Cyber Sea Server'); my $response = $browser->post($host, [ @parm_list ], @pf_headers); }


So I'm trying to find out if there is another setting I can put in the @pf_headers array or another $browser function that will make the post function not alter the data values in the @parm_list array.

In reply to Re^2: LWP::browser->post encoding data by ilauder
in thread LWP::browser->post encoding data by ilauder

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.