in reply to LWP::Curl and CURLOPT_USERPWD

For perl LWP, the more common way to login sets up authorization in the REQUEST:
$req->authorization_basic($username, $password);
"CURLOPT_USERPWD" seems to be a PHP option.

        This is not an optical illusion, it just looks like one.

Replies are listed 'Best First'.
Re^2: LWP::Curl and CURLOPT_USERPWD
by wanderedinn (Sexton) on Jun 06, 2016 at 20:12 UTC

    I don't see a reference to authorization_basic() for LWP::Curl. I'm doing a $lwpcurl->post() I assume the authentication would be a part of the post method.

    I had hoped I could include the username and password as curl will accept it with userid:password@http://... but it does not like that either.

      Hmm - you are right - looks like LWP::Curl does not implement an authentication mechanism. You may have to use plain LWP.

              This is not an optical illusion, it just looks like one.

        I have been able to resolve the 401 error by including the user id and password in the url as in http://username:password@hostname:4444

        So it appears I have a viable solution now. Thanks for all the assistance.