I've been unable to figure out how to get a "+" sign into
my POST request. Below is my code:
------ code -----
use LWP::UserAgent;
my $url = 'http://www.somewhere.se/cgi-bin/myscript.pl';
my $ua = LWP::UserAgent->new();
$ua->agent("MyBrowser");
# Create HTTP POST request
my $request = HTTP::Request->new(POST => $url);
$request->content_type('multipart/mixed; boundary=--gc0p4Jq0M2Yt08jU53
+4c0p');
$request->content('DataOne=A&DataTwo=1+&DataThree=20');
my $response = $ua->request($request);
---- end code -----
Now, what is important is that I'm able to send the "+"
sign as a real plus sign. However, the receiver side will
strip all + signs away, assuming they're spaces.
Isn't there any way of actually sending a
plus sign to the receiving script, using LWP?
Need help,
Denni
2002-02-09 Edit by Corion - Changed formatted code to CODE tags.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.