in reply to REST::Client GET with custom http headers authentication

Hi,

the only thing which comes to my mind at the moment is the following: In the depth of REST::Client headers are handled by HTTP::Headers. This module makes some "header sanitizing" which could cause your problem. Look here:

#!/usr/bin/perl use warnings; use strict; use HTTP::Headers; my $h = HTTP::Headers->new; $h->header('Content-Type' => 'text/plain'); # set $h->header('u' => 'user'); $h->header('p' => 'password'); print $h->as_string, "\n";
Your headers 'u' and 'p' are converted to uppercase.

Just a guess. Besides of that: Custom headers should use the X-blabla-namespace, in your case e.g. X-u and X-p.

McA

Replies are listed 'Best First'.
Re^2: REST::Client GET with custom http headers authentication
by Anonymous Monk on Feb 14, 2014 at 21:43 UTC
    Hi, Does this issue ever get resolved as i am hitting same error and looking for some resolution.
      Can you be more specific, what issue are you talking about? Which version of REST::Client do you have?
        I am using version 249. My code is similar to whats originally posted in this thread where I am adding custom header for username and password and then passing GET url using rest client but then keep on getting authorization failures from the app. So looking for some guidance.
        I am using version 249. My code is similar to whats originally posted in this thread where I am adding custom header for username and password and then passing GET url using rest client but then keep on getting authorization failures from the app. So looking for some guidance.