Your server is almost certainly objecting to this weird URL:

GET http://ap1492-dsr/../SetSessionVars.php?RoleId=102&HierarchyId=3

Note the superfluous ../. My copy of Apache returns HTTP 400 Bad Request responses for requests with a leading ../. I notice that the reason LWP is requesting this URL is that it receives an HTTP 302 Found response redirecting to it:

Location: ../SetSessionVars.php?RoleId=102&HierarchyId=3

Did you know that strictly speaking the Location header is supposed to contain an absolute URL, not a relative URI reference? Fixing the server to always provide correct absolute URLs in the Location header should solve the issue.

A workaround could be to set $URI::ABS_REMOTE_LEADING_DOTS to 1, because LWP uses the URI library to resolve relative URI references.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

In reply to Re: LWP fails where browser succeeds? by tobyink
in thread LWP fails where browser succeeds? by jcabraham

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.