The request you're creating isn't actually using url encoding, perhaps because you're working too hard at it by supplying your own headers. To see what I mean, add
print $req->as_string();
after you've created the request, and note that the form is
not correctly encoded. I suspect this is causing problems on the far end. A simpler approach is to do
use HTTP::Request::Common qw(POST);
$req = POST 'https://asite.com:443/adir/create_user.cgi', [
Content => "<User>John.Doe</User>"
];
print $req->as_string();
and note the difference. The form is correctly URL encoded, and
Content-length has been adjusted accordingly.
Note that once Crypt::SSLeay is installed, you don't need to use it explicitly. LWP will use it automagically when it sees 'https'. You can even leave :443 out of the URL, since it is implied by 'https'.
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.