http://www.perlmonks.org?node_id=1039297


in reply to REST::Client does not provide any output

Now my script does not print anything. It exits with nothing being printed on the screen.

Turn on debugging so that you can examine the request that gets sent

FWIW, I don't know what is x-Authorization , but its not like the thing you appear to be trying, its not like basic, this is basic

use HTTP::Request ; my $r = HTTP::Request->new('http://localhost'); $r->authorization_basic(qw/ user pass /); print $r->as_string; __END__ http://localhost - Authorization: Basic dXNlcjpwYXNz
  • Comment on Re: REST::Client does not provide any output (debugging x-authorization)
  • Download Code

Replies are listed 'Best First'.
Re^2: REST::Client does not provide any output (debugging x-authorization)
by Anonymous Monk on Jun 17, 2013 at 08:58 UTC

    Here is round trip using your data , note how it doesn't match :)

    #!/usr/bin/perl -- use Data::Dump; use HTTP::Request ; my $r = HTTP::Request->new('http://localhost'); $r->authorization_basic(qw/ username@system password /); dd( $r->as_string ); dd( $r = HTTP::Request->parse( $r->as_string ) ); dd( $r->authorization_basic ); __END__ "http://localhost -\nAuthorization: Basic dXNlcm5hbWVAc3lzdGVtOnBhc3N3 +b3Jk\n\n" bless({ _content => "", _headers => bless({ authorization => "Basic dXNlcm5hbWVAc3lzdGVtOnBh +c3N3b3Jk" }, "HTTP::Headers"), _method => "http://localhost", _uri => bless(do{\(my $o = "-")}, "URI::_generic"), }, "HTTP::Request") ("username\@system", "password")
Re^2: REST::Client does not provide any output (debugging x-authorization)
by slayedbylucifer (Scribe) on Jun 17, 2013 at 09:10 UTC
    The actual is "x-appname-Authorization". I removed the appname from the string as it is our application code name which is still under development. Thanks for your time.

      The actual is "x-appname-Authorization". I removed the appname from the string as it is our application code name which is still under development. Thanks for your time.

      Ok, but that still doesn't explain what protocol what rfc that x-authorization header is supposed to follow

      X- means non-standard , application specific , it doesn't explain what application, what protocol, what format

      I don't know how curl determines this, but I imagine if you turned on more debugging/verbosity in curl you might find out